Author Topic: $data->billTotal  (Read 2220 times)

marvays

  • Jr. Member
  • **
  • Posts: 423
    • richta.cz
  • Skype Name: marvays
$data->billTotal
« on: November 13, 2018, 12:47:17 pm »
Hi. I try make code module for VM3. In VM2 I used
Code: [Select]
<?php if ($data->billTotal == 0) { ?> Can I use this in VM3? Because, this not work :( I think, VM not use billTotal, but another one.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3491
  • VirtueMart Version: 3.8.9
Re: $data->billTotal
« Reply #1 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.

Regards
A

Joomla 3.9.27
php 7.4

marvays

  • Jr. Member
  • **
  • Posts: 423
    • richta.cz
  • Skype Name: marvays
Re: $data->billTotal
« Reply #2 on: November 13, 2018, 14:32:14 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

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3491
  • VirtueMart Version: 3.8.9
Re: $data->billTotal
« Reply #3 on: November 13, 2018, 15:59:47 pm »
billtotal in product details??

this is a cart variable
Regards
A

Joomla 3.9.27
php 7.4

marvays

  • Jr. Member
  • **
  • Posts: 423
    • richta.cz
  • Skype Name: marvays
Re: $data->billTotal
« Reply #4 on: November 13, 2018, 17:27:43 pm »
Yes. But in product detail i want make div with:
Code: [Select]
<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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10300
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: $data->billTotal
« Reply #5 on: November 13, 2018, 17:40:33 pm »
then u need to load the $cart object or get it from the session etc
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

marvays

  • Jr. Member
  • **
  • Posts: 423
    • richta.cz
  • Skype Name: marvays
Re: $data->billTotal
« Reply #6 on: November 13, 2018, 18:13:14 pm »
how?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10431
  • VirtueMart Version: 3+
Re: $data->billTotal
« Reply #7 on: November 14, 2018, 22:23:58 pm »
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');

marvays

  • Jr. Member
  • **
  • Posts: 423
    • richta.cz
  • Skype Name: marvays
Re: $data->billTotal
« Reply #8 on: November 15, 2018, 05:00:23 am »
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

Code: [Select]
<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

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10144
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: $data->billTotal
« Reply #9 on: November 16, 2018, 09:35:01 am »
Code: [Select]
$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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/