Forum
Foxycart - adding product option
I understand about adding a field to product.html I have added Weight as a custom field
How do I go about getting product options to be able to modify it ? In the same way that price can be modified for a particular option.
I have added code to options.edit.pre.php and options.edit.post.php
But there seem to be a number of files which need editing, and I want to make sure I get them all.
For example, although the admin page now shows options to set the weight for each option, it doesn't seem to be saved. Or maybe saved, but not retrieved
What else needs changing ?
Thanks in advance
Note : I tried adding a modifier {w:0.1} to option description. This does get passed and understood by Foxycart, but it is not combined with the price modifier . Instead of perch passing {w:0.1|p+10} as the correct string for Foxycart, it is passed as {w:0}{p+10}. So Foxycart modifies the weight but not the price. I have tried manually adding {w:0.1|p+10} to the option name but Foxycart still does not process the price change
Hi Tim
Please post your template code.
Have you copied over the templates as described in the documentation?
Rachel
I copied a modified product.html into /perch/templates/shop I didn't yet copy the options.edit.pre.php and options.edit.post.php as I wasn't sure where to put them. But have copies of original code ! )))
I have temporarily reverted the pages to standard as it is not working.
product.html :
added <perch:input type="hidden" name="weight" value="<perch:shop id="productWeight" />" />
options.edit.pre.php :
<?php $Products = new PerchShop_Products($API); $Options = new PerchShop_Options($API);
?>
options.edit.post.php :
<?php
?>
We can't support your modification of our add-on, I'm afraid. If you're going to change the files we're no longer in a position where we can usefully help.
Thanks Drew
I don't want to change the files. I want to know how I can legitimately support adding a product option.
You explicitly support adding custom fields into the templates.
All am I asking is how I can add a product option
This is not how you do it.
Is this a new implementation of FoxyCart? The add-on is about to be deprecated and then discontinued in favour of Perch Shop.
So perhaps you could advise how to do it?
No, I have been using it successfully for couple of years, now I need to extend its use
No news anywhere on your site that it is about to be deprecated.
The Perch Shop which is not even released yet ? I've been watching for its release but it's been on pre-release application-only basis for yonks. How do we have confidence in it ?
As mentioned earlier, I have put back all code.
There is no indication anywhere (e.g. a readme file in relevant directories) about what should not be touched. However there is plenty of encouragement to create customisations. So forgive me if I explored too far.
All I am asking is how to go about adding product options for additional fields. I am not asking you to do it for me, I'm just asking for guidance on how to do it.
Please let me know. Thank you
Please post your Diagnostics Report. You would have been asked for this when creating the thread.
I think to have different weights for each variant you'll need to add them each as a product - I don't think there's an option for it otherwise.
Thank you Drew