Hello to all
I am using VirtueMart 3.0.18 on Joomla! 3.6.5.
I use here https://www.leathercareland.com
the One Page Checkout for Virtuemart here http://vmonepage.com
and it works fine. It just changes the cart layout to be responsive and fits my needs. A. Selected Custom Fields in Cart
The problem that I have is that I cannot display the custom fields into the cart so that the buyer can make his choice or change a choice that he made. I think this is because of VM3 limitation where you cannot get the selectable list of custom field options in the cart. If you have selected i.e. the color or size in the product page then here at the cart it just displays the text of your selections. You don't get the drop down list of the custom field choices like you do on the product page. I have set Layout Position -> addtocart, Cart Attribute -> Yes, Cart Input-> Yes to all my custom fields. I see that into the file default_left.php (One Page Checkout file) around line 230 there is the code :
$customfiledstext = $this->customfieldsModel->CustomsFieldCartDisplay($prow);
$customfiledstext = str_replace("<br />", "", $customfiledstext);
echo str_replace('<span', '<span class="opg-text-small" ', $customfiledstext);
which displays your selection, if you had made any at the product details page. If you added to cart the product, that has custom fields, from category page, which means that you didn't make a selection of custom field value, at the cart you get COM_VIRTUEMART_PLEASE_CHOOSE. There is no dropdown list in to the cart.
Please add to cart the following item w/o making any selection for color : https://leathercareland.com/en/proionta/peripoiisi-dermatos/krema-gyalismatos-ypodimaton-high-gloss-shoe-cream-pate-de-luxe-2-detail which has a custom field SAPHIRE Colors and value COM_VIRTUEMART_PLEASE_CHOOSE. That is what is displayed into the cart.
I tried adding the same code that exists into the default.php file into the productdetails directory that is :
But this doesn't display anything also.
Could you advise me on what to do / try?
Is there any documentation on how to use Sublayouts outside of VM or at Cart? I found this (https://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
) but didn't help me at all...B. Mandatory / Required Custom Fields in Cart.
Now, if I can achieve to get the drop down selection in cart (point A) I would like to make those custom fields required / mandatory if possible. The products in shop that have custom fields have to have a value for custom field. Whoever shops must select a value for color and / or size. I have found this https://forum.virtuemart.net/index.php?topic=100172.0
buty is talking about child variants and not custom fields. There is also a hack including java script that marks with red the fields and pops up message that one has to make a selection but this is in the product page....
Thank you in advance