View Single Post
  #23  
Old 12-19-2016, 04:50 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Default Product Values

Quote:
Originally Posted by superdave144
There is no model subfolder in this directory. /opt/bitnami/apps/xcart/htdocs/var/run/classes/XLite/Module/JRG/Quantity

It sounds as you missed the "<?php" in the first line in that file, so XC5 doesn't consider this as a PHP script and ignores it.

Anyway, I've tried the code on my local installation and I see that overriding the method is not enough. You should also change \XLite\Model\Product::__constructor($data) as the $amount property is initialised with the constant, not with the value returned by the method. So, you should override it in the constructor as well.

Please check the attached custom module - it should work for you.
Attached Files
File Type: tar Custom-ForceDefaultQty-v5_3_0.tar (6.0 KB, 87 views)
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions