Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Sale price decimal placs
 
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-13-2019, 06:26 PM
 
_patricia _patricia is offline
 

Member
  
Join Date: Mar 2019
Posts: 14
 

Default Sale price decimal placs

Hi guys!

Does anyone know how to change the decimal of the sale price for the product?
We would like to change it from 2 to 3 decimal places.
Please take a look at the attached screenshot

Thank you!!
Attached Thumbnails
Click image for larger version

Name:	saleprice.PNG
Views:	8
Size:	21.3 KB
ID:	5394  
__________________
Multi-vendor 5.3.6.0
Reply With Quote
  #2  
Old 10-15-2019, 01:11 AM
 
Ed B. Ed B. is online now
 

eXpert
  
Join Date: Apr 2016
Posts: 218
 

Default Re: Sale price decimal placs

I think the problem comes from the following. In XLite/Model/Product.php, we have
Code:
/** * Product price * * @var float * * @Column ( * type="money", * precision=14, * scale=4, * options={ * @\XLite\Core\Doctrine\Annotation\Behavior (list={"taxable"}), * @\XLite\Core\Doctrine\Annotation\Purpose (name="net", source="clear "), * @\XLite\Core\Doctrine\Annotation\Purpose (name="display", source="n et") * } * ) */ protected $price = 0.0000;
whereas in XLite/CDeV/Sale/Model/Product.php we have
Code:
/** * "Sale value" * * @var float * * @Column (type="decimal", precision=14, scale=4) */ protected $salePriceValue = 0;
A solution would be modify the type of "Sale Value" to "money".
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #3  
Old 10-15-2019, 06:26 AM
 
Ed B. Ed B. is online now
 

eXpert
  
Join Date: Apr 2016
Posts: 218
 

Default Re: Sale price decimal placs

By the way, think of
  • deactivating the sale module
  • editing the database (wither with phpmyadmin or command line) to remove the column corresponding to "Sales Value" from the xc_products table
before testing new code, otherwise you will probably end up with errors.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #4  
Old 10-20-2019, 11:20 PM
 
_patricia _patricia is offline
 

Member
  
Join Date: Mar 2019
Posts: 14
 

Default Re: Sale price decimal placs

Quote:
Originally Posted by Ed B.
By the way, think of
  • deactivating the sale module
  • editing the database (wither with phpmyadmin or command line) to remove the column corresponding to "Sales Value" from the xc_products table
before testing new code, otherwise you will probably end up with errors.

Will try this, Thank you!!
__________________
Multi-vendor 5.3.6.0
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:51 PM.

   

 
X-Cart forums © 2001-2018