0

product shows stock as 1.00 -> how do i get it to show 1 (i get this to work in admin lists : admin/commerce/product but when showing in start screen or product detail page its 1.00..

how can I get rid of .00 ?

notice: I have and create some product and in admin/commerce/products/types/product/fields/commerce_stock stock field property it is disabled

edited I update the module to new released , I unnistall fully pervious version and install new, all stock set 0, in display of product display I can do it that dont show scale digits .00, but in edit of product display it is 0.00 with 2 digit scale yet

enter image description here

5
  • What version of drupal.org/project/commerce_stock are you using? drupal.org/node/1426066 says that's fixed.
    – jonpeck
    Commented Oct 24, 2013 at 23:10
  • @jonpeck Yes, I am using commerce_stock module
    – Yuseferi
    Commented Oct 25, 2013 at 4:54
  • No,Its not fixed for me, in commerce_stock field property it have a property scale and set to 2 , it is disable and I can change it. do you have a idea?
    – Yuseferi
    Commented Oct 25, 2013 at 4:56
  • Which version of that module are you using?
    – jonpeck
    Commented Oct 25, 2013 at 18:36
  • I use 7.x-2.0-alpha4 ,
    – Yuseferi
    Commented Oct 26, 2013 at 15:27

2 Answers 2

1

That bug has been fixed a long time ago; update from 7.x-2.0-alpha4 to 7.x-2.0-rc1. https://drupal.org/project/commerce_stock and that will fix it, along with a lot of other issues.

5
  • I update it, but yet in edit product display it is decimal with 2 scale !!!
    – Yuseferi
    Commented Oct 27, 2013 at 8:09
  • Editing only, not shown to users? I'm confident that's by design.
    – jonpeck
    Commented Oct 27, 2013 at 14:46
  • yes, only in editing :(
    – Yuseferi
    Commented Oct 28, 2013 at 20:21
  • That's not a bug. If you'd like to change how commerce_stock works, I'd suggest submitting a feature request to drupal.org/project/issues/commerce_stock
    – jonpeck
    Commented Oct 28, 2013 at 20:28
  • finally you tell me we can change stock field in edit ?
    – Yuseferi
    Commented Oct 28, 2013 at 20:45
0

Sorry folks, but i believe this is still an issue in current version 7.x-2.1. Although there is a decimal formatter option available in the manage display tab of the product settings page, it has no effect if you render the data outside Default, Full content, Line Item or Teaser settings.

For example if you load commerce product like this in a form template :

$product = commerce_product_load((int)$form['product_id']['#value']);

It still renders with default defined 2 decimal positions

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.