Re: Default Product Values
Quote:
As you said earlier, any change to X-Cart logic must be implemented as a module in order to avoid it getting rolled back after upgrade. |
Re: Default Product Values
That worked! Thank you!
|
Re: Default Product Values
Quote:
|
Re: Default Product Values
This fix doesn't seem to be working anymore. Is there a new place to put this value?
|
Re: Default Product Values
As far as I see the constant is still there (in the most recent 5.3.2.x version).
However, I think a better way of changing the default stock level is decorating the \XLite\Model\Product::getDefaultAmount() method, not AMOUNT_DEFAULT_INV_TRACK constant itself. Something like this: PHP Code:
|
Re: Default Product Values
Ok which file do I need to append this to? Am I adding code to a file or modifying existing code?
|
Re: Default Product Values
You should never edit existing files. Custom modification must be done as isolated modules with new files - this will help you to adapt the changes for future X-Cart versions.
The above is for a new PHP script - classes/XLite/Module/DEV_ID/MODULE_ID/Model/Product.php (you should replace DEV_ID and MODULE_ID with your ones). Of course, you should also add Main.php script as per the documentation. |
Re: Default Product Values
I'm sorry I've never done this before. Can you please provide a procedure?
|
Re: Default Product Values
Please follow this tutorial:
http://devs.x-cart.com/en/getting_started/step_1_-_creating_simplest_module.html You are to create a new module and add the file that I posted the source code for above. |
Re: Default Product Values
Ok I added the new module and enabled it. The Main.php is configured in /classes/XLite/Module/JRG/Quantity directory. I created the new product.php file in the /classes/XLite/Module/JRG/Quantity/Model/ directory. I redeployed the store after the module was created as well. The default quantity is still showing 1000. Do I need a reference from the Main.php to the product.php file?
|
All times are GMT -8. The time now is 01:30 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.