Is this is problem with AwoCoupon ?


  • Default avatar
    mile2    
     4 years ago
    0

    Please see this : I post this on VIrtumart forum but i want to ask here too :


    http://forum.virtuemart.net/index.php?topic=107598.0
  • Default avatar
    mile2    
     4 years ago
    0

    Please see the attachments

    http://i49.tinypic.com/1179wec.jpg Pic 1



    http://i47.tinypic.com/2pzwa69.png Pic 2
  • Your avatar
    seyi    
     4 years ago
    0

    It is not an AwoCoupon problem.

    The question was if the total is equal to the coupon discount, so an order total of 0, nothing is displayed in the template. So instead of
    Total: $0.00
    you see
    Total:

    My suggested fix requires hacking Virtuemart
    file www/administrator/components/com_virtuemart/helpers/currencyDisplay.php find function createPriceDiv
    <?php
        
    public function createPriceDiv($name,$description,$product_price,$priceOnly=false,$switchSequel=false,$quantity 1.0){

            
    //         vmdebug('createPriceDiv '.$name,$product_price[$name]);
            
    if(empty($product_price)) return '';
    ?>


    and change
    <?php
    if(empty($product_price)) return '';
    ?>

    to something like this
    <?php
    if(empty($product_price)) return '0.00';
    ?>

  • Default avatar
    mile2    
     4 years ago
    0

    Thank you . What about the second $450 Price ? It should say - $450 right ? How to fix that ?

    Thanks
  • Your avatar
    seyi    
     4 years ago
    0

    Im not sure what you mean.
  • Default avatar
    mile2    
     4 years ago
    0

    On Pic 2 : The coupon code is for 100 % off and is don't says -$450 it just show me two $450 is this right ?
    Why the second Price is not showing -$450 because is after the discount ?

    See picture : http://i47.tinypic.com/33m98g3.png
  • Your avatar
    seyi    
     4 years ago
    0

    the second $450 is the discount amount. You would have to edit your template to show it as negative.
  • Default avatar
    mile2    
     4 years ago
    0

    Can you help me with that ? I which file i need to put "-" ?

    Thanks
  • Your avatar
    seyi    
     4 years ago
    0

    you will need to look in your template file, its either in
    www/components/com_virtuemart/views/cart/default_pricelist.php

    or
    www/templates/[your_template]/html/com_virtuemart/cart/default_pricelist.php


    search for coupon and somewhere you should find the entry.
  • Default avatar
    mile2    
     4 years ago
    0

    I have the word "coupon" on this places in default_pricelist.php:

    <?php
            
    if (VmConfig::get('coupons_enable')) {

            
    ?>






    <?php
     
    if(!empty($this->layoutName) && $this->layoutName=='default') {

                           
    // echo JHTML::_('link', JRoute::_('index.php?view=cart&task=edit_coupon',$this->useXHTML,$this->useSSL), JText::_('COM_VIRTUEMART_CART_EDIT_COUPON'));

                            
    echo $this->loadTemplate('coupon');

                        }

                    
    ?>




    <?php
     
    if (!empty($this->cart->cartData['couponCode'])) { 
    ?>


    <?php
                            
    echo $this->cart->cartData['couponCode'] ;

                            echo 
    $this->cart->cartData['couponDescr'] ? (' (' $this->cart->cartData['couponDescr'] . ')' ): '';

                            
    ?>





    <?php
     
    echo $this->currencyDisplay->createPriceDiv('couponTax',''$this->cart->pricesUnformatted['couponTax'],false); 
    ?>


    <?php
     

    ?>


     

    <?php
     
    echo $this->currencyDisplay->createPriceDiv('salesPriceCoupon',''$this->cart->pricesUnformatted['salesPriceCoupon'],false); 
    ?>



    So what do i need to change ?

    This is my default_pricelist.php file :

    http://www.mediafire.com/?beehz03gadmanbb
  • Your avatar
    seyi    
     4 years ago
    0

    the code with salesPriceCoupon, you can make that negative.
  • Default avatar
    mile2    
     4 years ago
    0

    Thank you Seyi . Last question :

    What exactly i need to change in the code to make it negative ?

    <?php
     
    echo $this->currencyDisplay->createPriceDiv('salesPriceCoupon',''$this->cart->pricesUnformatted['salesPriceCoupon'],false); 
    ?>



    Thanks
  • Your avatar
    seyi    
     4 years ago
    0

    <?php
    echo (-1*$this->currencyDisplay->createPriceDiv('salesPriceCoupon',''$this->cart->pricesUnformatted['salesPriceCoupon'],false)); 
    ?>
  • Default avatar
    mile2    
     4 years ago
    0

    This code is not working

    The only thing is do for me is to making the second price 0

    I want to say - the price of the product like in the old VM

    http://i46.tinypic.com/1zvsh6o.png

    Can this be done ?

  • Default avatar
    mile2    
     4 years ago
    0

    I just figure this out .

    For other people wondering this is the correct code :

    <?php
     
    echo $this->currencyDisplay->createPriceDiv('salesPriceCoupon',''$this->cart->pricesUnformatted['salesPriceCoupon']* -1,false); 
    ?>
  • Default avatar
    dan619    
     3 years ago
    0

    Hi,

    I am having this same issue with the createPriceDiv and a coupon. It's an auto shipping coupon but doesn't seem to apply automatically. I tried applying the coupon manually which submitted the page and then it bombs on createPriceDiv.

    I tried your solution of editing the createPriceDiv function but it behaves the same way.

    My setup:

    Joomla 2.5.6
    VM 2.0.14
    AWO Pro 2.1.2

    Any ideas? Thanks.

    Dan
  • Your avatar
    seyi    
     3 years ago
    0

    Hi Dan,

    That solution was for display a 0.00 instead of *blank* as the total if the customer enters a coupon that discounts everything.

    The solution you need is this:
    in www/components/com_virtuemart/helpers/cart.php, find this line of code
    <?php
    return $this->redirecter('index.php?option=com_virtuemart&view=cart&task=edit_coupon' $redirectMsg);
    ?>


    and comment it out
    <?php
    //return $this->redirecter('index.php?option=com_virtuemart&view=cart&task=edit_coupon' , $redirectMsg);
    ?>
  • Default avatar
    dan619    
     3 years ago
    0

    Hi Seyi,

    Thanks. commented out that part in my select_payment template and I don't have the issue anymore. However, the automatic selection of the discount doesn't work. If I enter in the code the discount is applied though. I followed tutorials/posts on this site to setup the shipping coupon and automatic discount

    Any ideas why automatic discount isn't working? Are there any reasons that you know of beyond misconfiguration of the coupon and automatic discount that would prevent the automatic discount from occuring?

    Thanks.

    Dan
  • Your avatar
    seyi    
     3 years ago
    0

    Hi Dan,

    No, it should work if you set it up correctly. Have you verified that the plugin "VMPayment - AwoCoupon" is enabled? Also the automatic discount itself, make sure it shows up on the automatic discount screen and is enabled.