News:

Support the VirtueMart project and become a member

Main Menu

Cart Page Fields & Modifications

Started by PRO, August 15, 2012, 15:10:06 PM

Previous topic - Next topic

PRO

views/cart/tmpl/default_pricelist.php

right after this
<div class="billto-shipto">


illPhever

Hello,

Thanks for the tips.  I think this is what I need to make sure the tax does not show up in my cart until a shipping address is provided:

<?php if (empty($this->cart->BT)){ ?> What you put here will be shown when NO billing address is completed<?php }?>

I have already setup a template override, but where in default_pricelist.php does this code go? 

PRO

Quote from: illPhever on January 03, 2013, 20:26:33 PM
Hello,

Thanks for the tips.  I think this is what I need to make sure the tax does not show up in my cart until a shipping address is provided:

<?php if (empty($this->cart->BT)){ ?> What you put here will be shown when NO billing address is completed<?php }?>

I have already setup a template override, but where in default_pricelist.php does this code go? 


if you are not familiar with php.

You should do the 2nd suggestion

all you have to do is add this
<?php if (empty($this->cart->BT)){ $rule=Null;}?>

after this
<?php foreach($this->cart->cartData['taxRulesBill'] as $rule){ ?>


See example below

<?php foreach($this->cart->cartData['taxRulesBill'] as $rule){ ?>
      <?php if (empty($this->cart->BT)){ $rule=Null;}?>
         <tr class="sectiontableentry<?php $i ?>">
            <td colspan="4" align="right"><?php echo $rule['calc_name'] ?> </td>
            <?php if ( VmConfig::get('show_tax')) { ?>
            <td align="right"><?php echo $this->currencyDisplay->createPriceDiv($rule['virtuemart_calc_id'].'Diff','', $this->cart->pricesUnformatted[$rule['virtuemart_calc_id'].'Diff'],false); ?> </td>
             <?php } ?>
            <td align="right"><?php ?> </td>
            <td align="right"><?php echo $this->currencyDisplay->createPriceDiv($rule['virtuemart_calc_id'].'Diff','', $this->cart->pricesUnformatted[$rule['virtuemart_calc_id'].'Diff'],false); ?> </td>
         </tr>
         <?php
         if($i) $i=1; else $i=0;
      }
?>

This code <?php if (empty($this->cart->BT)){ $rule=Null;}?>   sets the rule to Null if the billing is not filled in



illPhever

That's a little better, it takes the Tax line item out of the cart, but the Total still calculates the the tax amount prior to adding a shipping address. And when I use the code suggested to "subtract the tax from the total", the Total is calculated without the tax but the Tax amount is still visible on the Total line.

prem prakash

Hi every one ! I need to customize the virtuemart registration form according to the following requirements:-

->I need to add make a new dependent field of locality binded with the dropdown field of states , so that when ever a frotend user is registring at virtuemart he can select the state and after the selection of state the corresponding areas of the selected states can be pulled from the database as the user select states .

->  like wise there is one dependent field of sublocality which is binded with the above mentioned area field .

->Like this i have some field that are need to be validated .
->Now I know that i can create new fields from the admin panel of virtuemart but how to validate them and setup their and interaction with database

->I am using virtuemart 2.0 Latest virsion

->kindly help me with this

Thank you .

servlet

Он-лайн магазин за фототапети [url="http://mishelfoster.com"]http://mishelfoster.com[/url]

PRO


Maxim Pishnyak

Lol, that post above your post, Pro, really rocks!

It's not enaf to give some advices to VM users nowadays! Each advice MUST have a link to a demo.

Hell, I'll create a petition for this somewhere: "We want DEMO! We want DEMO! We want DEMO!!!"
You can support Community by voting for Project on the JED
[url="https://extensions.joomla.org/extension/virtuemart/#reviews"]https://extensions.joomla.org/extension/virtuemart/#reviews[/url]
Join us at
[url="https://twitter.com/virtuemart"]https://twitter.com/virtuemart[/url]

syntalk

Hi,

Would it be possible to add additional "select field" to the cart or as a "step" and make it required? I want to add "preferable delivery time" to the cart page that customer can make a choice of the time the items should be delivered on.
I have a CUSTOM FIELD and can add it to the shippment address or CUSTOMER DETAILS and something like that would be perfect in the cart or as a step.

Many thanks in advance

PRO

Quote from: syntalk on April 06, 2013, 16:39:52 PM
Hi,

Would it be possible to add additional "select field" to the cart or as a "step" and make it required? I want to add "preferable delivery time" to the cart page that customer can make a choice of the time the items should be delivered on.
I have a CUSTOM FIELD and can add it to the shippment address or CUSTOMER DETAILS and something like that would be perfect in the cart or as a step.

Many thanks in advance



not without someone custom coding it for you


why not just leave it in the shipping adrres field?

syntalk

Quote from: PRO on April 06, 2013, 18:26:56 PM
why not just leave it in the shipping adrres field?

Hi mate and thanks,

Yes, I think it's the best and easiest option for now. However not everyone uses shipping address, in this case I'll need to put this in the normal/invoice address. Also making this available in the cart would make it easier to the customer to change on every order..
Thank you anyway!

Stonedfury

Quote from: PRO on August 15, 2012, 15:10:06 PM
Here are some fields for modifying the cart page to make it more user friendly.

I use these fields to make my own "checkout steps"

<?php if (empty($this->cart->BT)){ ?> What you put here will be shown when NO billing address is completed<?php }?>

<?php if (!empty($this->cart->BT)){ ?> This shows AFTER the billing Address is completed <?php }?>

<?php if ($this->cart->cartData['paymentName'] == 'No payment selected') {?> This shows when the payment has NOT been selected<?php }?>
^^^ "No payment selected" is English, so change it to suit your language

<?php if ($this->cart->cartData['paymentName'] != 'No payment selected') {?> AFTER Payment Has Been Selected<?php }?>
^^ Same language applies here.


This code will change the text from "Add Your Billing" to Edit Your Billing, if the billing is already filled in.
      <?php if (empty($this->cart->BT)){ ?>
      <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL) ?>">
      Add Your Billing Address
      </a>   <?php } ?>
<?php if (!empty($this->cart->BT)){ ?>
      <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL) ?>">
      Edit Your Billing Address
      </a>   <?php } ?>

This Code will display "Shipping to a Different Address?"  when the billing is filled in, but NOT the shipping.

      <?php if ((!empty($this->cart->BT)) && (empty($this->cart->ST))){ ?>
      <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL) ?>">
      Shipping to a different address? </a><?php } ?>

Displays "Edit Your Shipping Address" When its already filled in

      <?php if(!empty($this->cart->STaddress['fields'])){ ?>
      <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL) ?>">
      Edit Your Shipping Address
      </a> <?php }?>
Are these lines to be added or is this a find and replace? Also which files would this be? There are issue with customers not putting in address and trying to put in payment and shipping information. This code will help buyers find their way as VM2 is not direct enough.

I seriously appreciate any and all help!
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

Stonedfury

Hello again. In addition to my last question. Is is possible to make the checkout button change. One for "Confirm & Save Details" Then after that. "Checkout"? I ask because customers get lost in the loop. "Why did I have to click two time, Why did it not complete after I clicked it? Page just refreshed so I abandoned" <- actual quotes. I cannot make this shit up.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

PRO

#28
Stonedfury

go to my website & see how my checkout is done,
you will see it makes things easier

I use this to include my steps
<?php include("steps.php"); ?>

then I have a php file called steps.php

in the same folder



this is the file
<?php if (empty($this->cart->BT)){ ?><span class="redtext bold left10">!</span> <a class="details bold font14 m4" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT',$this->useXHTML,$this->useSSL) ?>">
      Please Fill Out Your Billing Address
      </a><br/><?php }?>
<?php if (!empty($this->cart->BT)){ ?><img alt="Attention" src="/images/green.png" /> Billing Address Completed<br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] == 'No payment selected') {?><span class="redtext bold left10">!</span> <?php $this->select_payment_text='Select Your Payment Method'; echo JHTML::_('link', JRoute::_('index.php?view=cart&task=editpayment',$this->useXHTML,$this->useSSL), $this->select_payment_text,'class="bold details font14 m4"'); ?>  <br/><?php }?>

<?php if ($this->cart->cartData['paymentName'] != 'No payment selected') {?><img alt="Attention" src="/images/green.png" /> Payment Selected <br/><?php }?>
<?php if ((!empty($this->cart->BT)) && (empty($this->cart->ST))){ ?>
      <a class="details bold font14" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=ST&virtuemart_user_id[]='.$this->cart->lists['current_id'],$this->useXHTML,$this->useSSL) ?>">
      Ship to a different address? </a><?php } ?>

<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )&& ($this->cart->tosAccepted)){
echo '<div class="bottom10 border bold center lightcream top10 left10 bblack" style="width:255px;font-size:21px;">';
         echo $this->checkout_link_html;
         $text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo '</div>';

}?>



I actually change the text of
COM_VIRTUEMART_ORDER_CONFIRM_MNU

to "Place order now"

Stonedfury

Can I please get a link to your website sir?
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.