I am currently using 1.4.9.1 (and am willing to update to 1.5 if it will help). Is there a way to automatically update a product's Data -> Quantity when Option -> Quantities values are modified? The objective is to keep the quantities synchronized so that we only have to update the quantity in one location instead of two.
If there isn't an existing solution, how do I hook into the code to provide my own jQuery solution (this would take less than 10 lines). Obviously it would be the most useful in module format so that upgrades have a fighting chance.
So far I haven't found a way to accomplish either option via existing modules, forum posts, or OpenCart documentation. Links to similar modules or forum posts that I missed are welcome -- I'm not afraid of code or documentation. Thanks!
If there isn't an existing solution, how do I hook into the code to provide my own jQuery solution (this would take less than 10 lines). Obviously it would be the most useful in module format so that upgrades have a fighting chance.
So far I haven't found a way to accomplish either option via existing modules, forum posts, or OpenCart documentation. Links to similar modules or forum posts that I missed are welcome -- I'm not afraid of code or documentation. Thanks!
This doesnt make any sense.Daga wrote:I am currently using 1.4.9.1 (and am willing to update to 1.5 if it will help). Is there a way to automatically update a product's Data -> Quantity when Option -> Quantities values are modified?
If you wish to update all option quantities when 1 option has been purchased, then its simple. Dont use option quantities.
Set each option to no subtract stock, and add up every option quantity and use that as the total product quantity.
That way every time the product is purchased regardless of the option 1 will be subtracted.
You will know which option that was because it will be displayed on the order confirmation.
Thats the only way i can think of that meets what you require.
There is currently no way to keep track of option stock quantity when you "build" a product based on different options.
For example, if you sold a blue shirt size small, and your options where size, and colour.
it wont reduce the qty by 1.
The only way I can see of doing it is as follows:
Create your options like this as one option rather than 2 separate options
i.e. Option Name: Size/Colour
Values: Small/Blue, Small/Green etc etc
Then in product add your options with quantities and set subtract stock to Yes for eac option.
Total up all the quantities and put the total in the main product Data section, again setting Subtract Stock to Yes.
When someone purchases a product, both the main qty and option qty will reduce by qty purchased.
Ideal, not really. The options stocking has a long way to in development.
Likewise with restocking on cancelled orders etc
Create your options like this as one option rather than 2 separate options
i.e. Option Name: Size/Colour
Values: Small/Blue, Small/Green etc etc
Then in product add your options with quantities and set subtract stock to Yes for eac option.
Total up all the quantities and put the total in the main product Data section, again setting Subtract Stock to Yes.
When someone purchases a product, both the main qty and option qty will reduce by qty purchased.
Ideal, not really. The options stocking has a long way to in development.
Likewise with restocking on cancelled orders etc
What Simon suggested is what we are doing right now. I was hoping for a way to automate half of the process. Oh well, thanks, guys. This is what I was afraid of from the appearance of the modules that do exist, but wanted to double-check. It may be easier for us not to track inventory at all through OpenCart. :-/
To be honest Daga, in theory it should be entirely possible using some simple javascript, becuase the product editing screen, although split up in to tabs is actually just one big screen with some javascript magic.
Leave it with me and I will see if I can code something up.
I've seen the Auto SEO Keyword script which works in a similar way but grabs the product name, model name etc as it is typed.
Therefore it should be a similar process for recognising key presses in the options quantity boxes, find all options quantity values, adding them up and dumping the total in the main quantity box.
Leave it with me and I will see if I can code something up.
I've seen the Auto SEO Keyword script which works in a similar way but grabs the product name, model name etc as it is typed.
Therefore it should be a similar process for recognising key presses in the options quantity boxes, find all options quantity values, adding them up and dumping the total in the main quantity box.
Nice! Although they require the inclusion of "view/javascript/autoseo.min.js" in the administrative head template. That's all that I was really hoping for via some programmatic hook.
If you want, I can write the JavaScript. It would involve locking the overall quantity textbox if there are option quantities (to prevent accidental user entry) and then, as you noted, the addition of the other boxes is easy.
Unless you want another module under your belt.
If you want, I can write the JavaScript. It would involve locking the overall quantity textbox if there are option quantities (to prevent accidental user entry) and then, as you noted, the addition of the other boxes is easy.
Unless you want another module under your belt.
Feel free to have a play, I probably wont be bale to get around to it until mid next week now (too busy with clients)
But will have a look when I can find five minutes to spare.
But will have a look when I can find five minutes to spare.
well there are no programmatic hooks available, but I highly recommend you look into vqmod which would allow you to add it without editing the file.Daga wrote:Nice! Although they require the inclusion of "view/javascript/autoseo.min.js" in the administrative head template. That's all that I was really hoping for via some programmatic hook.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
vQmod is cool. I can take it from here and plan to post back when this is working in a way someone else may need.Xsecrets wrote:well there are no programmatic hooks available, but I highly recommend you look into vqmod which would allow you to add it without editing the file.
We had the same issue but I created an hourly cronjob that sums the option quantities and then updates the quantity shown on the data tab. In case it helps anyone else, here's the query:
Code: Select all
UPDATE product AS p INNER JOIN (SELECT product_option_value.product_id, SUM(product_option_value.quantity) AS quantity_sum FROM product_option_value GROUP BY product_option_value.product_id) AS pov SET p.quantity=pov.quantity_sum WHERE p.product_id=pov.product_id
Hello,
I want to add 1 pound or 1.5 Euro in total product price if some one select special product option ... so what is the solution of this problem can any one ask me?
version:1.5
Thank you & Regards
Sanju
I want to add 1 pound or 1.5 Euro in total product price if some one select special product option ... so what is the solution of this problem can any one ask me?
version:1.5
Thank you & Regards
Sanju
Hmmm, this didn't work for me. I got the following email message on completion of the cron....phatpixel wrote:We had the same issue but I created an hourly cronjob that sums the option quantities and then updates the quantity shown on the data tab. In case it helps anyone else, here's the query:
Code: Select all
UPDATE product AS p INNER JOIN (SELECT product_option_value.product_id, SUM(product_option_value.quantity) AS quantity_sum FROM product_option_value GROUP BY product_option_value.product_id) AS pov SET p.quantity=pov.quantity_sum WHERE p.product_id=pov.product_id
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `UPDATE product AS p INNER JOIN (SELECT product_option_value.product_id, SUM(product_option_value.quantity) AS quantity_sum FROM product_option_value GROUP BY product_option_value.product_id) AS pov SET p.quantity=pov.quantity_sum WHERE p.product_id=pov.product_id'
ANY THOUGHTS what the problem might be??
Who is online
Users browsing this forum: No registered users and 130 guests