VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: gyam on October 23, 2014, 20:02:10 PM

Title: Custom field stockable customisation and delivery management
Post by: gyam on October 23, 2014, 20:02:10 PM
Hi,

I got one product with 6 childs and a size custom field stockable option.
I'm looking to change the field which is called in <span class="product-field-display"><?php echo $field->display ?></span> - eg modify the <span> stuff inside. Where can I get the code building for that?

Then, as I got different stock values for the childs, I'd like to get the delivery delay pictures to follow the chosen option.
At this moment, as soon as I set the childs, custom field etc in the parent product, the picture disappears and nothing change if I choose another size... Any clue about that?

Thx for help.
Title: Re: Custom field stockable customisation and delivery management
Post by: jenkinhill on October 23, 2014, 21:01:33 PM
I've given up guess work. What versions of Joomla/VirtueMart are you using and what is the URL?
Title: Re: Custom field stockable customisation and delivery management
Post by: gyam on October 24, 2014, 10:32:10 AM
Hi Jenkinhill,

I'm on 2.5.27, php 5.5.14. For VM, that's 2.6.10.
I send you the adress in MP as the website is under construction.
Title: Re: Custom field stockable customisation and delivery management
Post by: jenkinhill on October 24, 2014, 11:05:20 AM
I don't read PMs.

In VM2.6.12 (and older versions) the file to edit/override is components/com_virtuemart/views/productdetails/tmpl/default_customfields.php unless you already use an override for that, in which case it will be [your joomla template]/html/com_virtuemart/productdetails/default_customfields.php
Title: Re: Custom field stockable customisation and delivery management
Post by: gyam on October 24, 2014, 13:01:41 PM
Hi,

I found that file but to get a proper design, I have to override the "echo $field->display" within the code (mainly remove the <br>)

<div class="product-field product-field-type-E">
<span class="product-fields-title">
<strong>Taille</strong>
</span>
<span class="product-field-display">
<br>
<div id="stockableBlockIndex_1_0" class="stockable_block_1">
<input type="hidden" name="customPlugin[1][stockable][child_id]" value="2">
<script language="javascript">
<input type="hidden" name="customPrice[1][4]" value="1">
</span>
<span class="product-field-desc"></span>
</div>


then, I have to find a way to change the delivery time (and picture) following the choice. Do you think it's possible?

*edit: You can check @ http://www.petit-c.fr/index.php?piedeleurestraint=1 (to override the "under construction" stuff) then reach the page http://www.petit-c.fr/boutique-en-ligne/robes/robe-cainta-detail
Title: Re: Custom field stockable customisation and delivery management
Post by: gyam on October 26, 2014, 08:54:37 AM
Ok, for the "avaibility" issue, I went deeper in the code.
I think it's a prbl inside stockable.php (plugins/vmcustom/stockable). But at this stage, there's some javascript and I don't really know this language.

On the website, I've set all childs (and the parent too) with "3-5 days". General stock management is set to show "10days" if no more stock.
As result, I got no avaibility except if the stock is empty which show....tada....the "3-5days" image ?!?

Still no success to change the <span class="product-field-display"><?php echo $field->display ?></span>. I continue to look for the piece of code which built the "->display".