Jump to content

[Resolved] Changing product from physical to digital


Robin Somes

Recommended Posts

CC 6.06, All In One Shipping 1.0.6, Product AddOns 1.0.5. browser: Google Chrome.

More of an observation than an issue, since its impact is low. I create a product consisting of a physical item to be shipped, let's say an e-book on CD-ROM. Item A. It has a shipping weight of 0.12 kg.  Later, I wish also to make the e-book available as a download - which is identical to the CD-ROM version except in the form of its delivery. Item B. As the item's description is quite long, and I'm lazy that way, I clone Item A, make a few minor changes to the description, change the category, add the digital download file, and save it as Item B - which is now listed as a digital item. Excellent. 

However, no matter how many times I change or delete the product weight on the General Information tab, when the product is saved, the weight reappears as 0.12 kg, and is featured on the product page on the shop site.

Overall effect on my life, almost zero, but perhaps it's something that might be ironed out in a future release?

Robin

Link to comment
Share on other sites

I can see in the code where a weight of a blank entry when editing (adding, not so much) a product would be an issue, but you say that changing the weight from 0.12 to 0.04 (for example) still doesn't stick?


(I would have to observe the AddOn mod's output to accept or reject placing blame on it.)

Link to comment
Share on other sites

Hmmm, OK. If I *change* the weight, having cloned the product, then it stays at the new weight. If I set the weight to 0.000, then it stays set at that figure - and then, no weight appears on the product page of the site - exactly as I want.

But it just seems a little odd that, once the Product Weight field has a value (even if that value is 0.000), it cannot subsequently revert to having no value - if you see what I mean.

Robin

Link to comment
Share on other sites

It is strange, but for some (possibly legacy) reason, the product's weight, stock level and stock warning level is ignored if the value is considered 'empty', except for specific values of '0' and '0.0'.

PHP interprets values in POST submissions and GET querystrings as "string" variable types. So, an entry of 0 is not so much the physical concept of nothing present, but simply the literal character '0' that gets displayed. As such, there is a difference between the character sequences (strings of characters) of '0.0'and '0.00'. For the above mentioned settings, CC6 will discard a value that can be understood as 'empty' (not set, null, '' <- a string of length zero, 0, '0', '0.0', and false) except keep the actual strings of characters of '0' and '0.0'. Thus, note that '0.000' will not be discarded because the string representation of that value is not considered 'empty' as it is not the same as '0.0'.

In conclusion, attempting to change the value to a blank text field will not work. You must enter 0.

(There may also be code that, on the storefront, suppresses the display of the weight if the item is determined to be digital, even if some weight has been given to that item.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...