Jump to content

Stock levels from external source, problem with product combinations


svagner

Recommended Posts

Hi,

I'm developing a tiny module to get live stock levels from an external source. Currently I have 2 manufacturers, which have their stock levels available on their websites (xml and csv formats), they are updating the levels every ~10 minutes.

 

My module is hooked to 'hookextraRight'. The module takes the $product->supplier_reference, gets the stock level and displays a small info block just below the 'buy_block' form. My module so far works ok.

 

Now I'm lost with the new manufacturer, who has products with combinations (different colors). Once the product with combinations is displayed, the stock level for the 'default' combination is parsed and displayed. When selecting a different combination (different color) I have no idea how to call my hookExtraRight function again to get the stock level for the selectedCombination['reference'] updated.

 

Can I somehow use the hook's code from the javascript (product.js) ? Well, probably not...

Or should I use 2 functions to get stock levels (leave php on hookExtraRight and add javascript+jQuery version for combinations) ?

Or should I leave completely the 'module + hook' idea and override the whole class and/or controller ?

 

I would appreciate any idea or help.

Thanks.

 

(PrestaShop 1.4.8.2)

Link to comment
Share on other sites

Hello svagner,

 

Not spamming your topic or nothing and do apologize if I get off subject but may I ask which module are you using for this? I want to set it up with my distributors and would save me tons of time.

 

I appreciate your help

Clayton

 

Hi Clayton,

well, I'm trying to compile my own module from scratch, I haven't found any suitable module or template to start with. I'm not a beginner (even though PrestaShop novice) but I'm learning on the fly. My 'module' is yet far away from being ready, it has too many limits. Currently I'm stuck with all the javascript and object model and controllers and I'm not sure if I'm on the correct track. OK, anyway, once I learn something new, I'll try to drop a message here.

SV.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...