X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Sale price decimal placs (https://forum.x-cart.com/showthread.php?t=77256)

_patricia 10-13-2019 06:26 PM

Sale price decimal placs
 
1 Attachment(s)
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!!

Ed B. 10-15-2019 01:11 AM

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".

Ed B. 10-15-2019 06:26 AM

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.

_patricia 10-20-2019 11:20 PM

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!!


All times are GMT -8. The time now is 11:35 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.