Hi. I try make code module for VM3. In VM2 I used <?php if ($data->billTotal == 0) { ?> Can I use this in VM3? Because, this not work :( I think, VM not use billTotal, but another one.
where are you expecting to use this variable
Looks like prepareAjaxData in components\com_virtuemart\helpers\cart.php
More information may help you get an useful answer.
Quote from: AH on November 13, 2018, 13:26:05 PM
where are you expecting to use this variable
Looks like prepareAjaxData in components\com_virtuemart\helpers\cart.php
More information may help you get an useful answer.
in product detail Page . . . http://www.lukysipy.cz.hyperion.blueboard.cz/eshop/lazecky-pioneer-nature-dlouhy-luk-68
billtotal in product details??
this is a cart variable
Yes. But in product detail i want make div with:
<div class="motivator" style="padding: 10px;color: #f15259;text-align: center;text-transform: none;">
<?php if ($data->billTotal == 0) { ?>
<span style="animation: blinker 2s linear infinite;">When ordering over 100, - is shipping free!</span>
<?php } elseif ($data->billTotal < 5000) { ?>
<span style="animation: blinker 2s linear infinite;">Do you want to transport for free? Add more products for: <?php echo (5000 - ($data->billTotal)) ?>,-</span>
<?php } else { ?>
<span style="font-weight: 700; color: #109d16;">Your order will be shipped free of charge!</span>
<?php } ?>
</div>
And for it i need know price of all product in cart.
then u need to load the $cart object or get it from the session etc
how?
or setup a cart module, then do your own override for it
then you have to load it in your details page where you want it
public static function mod_by_position($position){
jimport('joomla.application.module.helper');
$modules = JModuleHelper::getModules($position);
$html='';
foreach ($modules as $module) {
$html.=JModuleHelper::renderModule($module);
}
return $html;
}
echo mod_by_position('my-position');
Hm, I am not understand. Php are not for me :(
We must reload bak. I have code to cart module, who work on version 2.
live here: https://www.lukysipy.cz
When I put in a basket, the module changes the text
<div class="motivator">
<?php if ($data->billTotal == 0) { ?>
<span style="animation: blinker 2s linear infinite;">Při objednávce nad 5000,- je doprava zdarma!</span>
<?php } elseif ($data->billTotal < 5000) { ?>
<span style="animation: blinker 2s linear infinite;">Chcete dopravu zdarma? Přidejte ještě zboží za: <?php echo (5000 - ($data->billTotal)) ?>,-</span>
<?php } else { ?>
<span style="font-weight: 700; color: #109d16;">Vaše objednávka bude dopravena zdarma!</span>
<?php } ?>
</div>
When I use this on J3.9 and VM 3.4.2 cat show me first testy variant. And when I add produst to cart, text not change. where I have problem?
Test page here: http://www.lukysipy.cz.hyperion.blueboard.cz
$cart = VirtueMartCart::getCart();
vmdebug('Lets see the cart object',$cart);
Just enable the vmdebug to see now the whole cart and how the information is stored