VirtueMart Forum

VirtueMart 2 + 3 => Templating & Layouts => Topic started by: PRO on August 15, 2012, 15:10:06 pm

Title: Cart Page Fields & Modifications
Post by: 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 }?>


A couple ways of NOT displaying taxes & calculation rules when billing address is not filled in. BUT, the total will include the tax amount, but can also be wrapped.

<?php if (!empty($this->cart->BT)){ ?>
WRAP the calculation in this code
?>

OR: You can set the rule to 0 , if no billing address is filled in.

<?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



If the billing address is not filled in, you can subtract the tax from the total. To show the total without tax.
<?php if (empty($this->cart->BT)){$this->cart->pricesUnformatted['billTotal']=$this->cart->pricesUnformatted['billTotal']-$this->cart->pricesUnformatted['billTaxAmount'];}?> <?php echo $this->currencyDisplay->createPriceDiv('billTotal','', $this->cart->pricesUnformatted['billTotal'],false); ?>

THIS code will display the "Confirm order button" where you want it. ONLY when the billing & payment has been filled in
<?php if ((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') ){
 echo '<h1 class="bottom10 border" style="width:180px;">';
         echo $this->checkout_link_html;
         $text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo '</h1>';

}?>

Same code as above, but checks if "terms of service are checked"
<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )&& ($this->cart->tosAccepted)){
 echo '<h1 class="bottom10 border" style="width:180px;">';
         echo $this->checkout_link_html;
         $text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo '</h1>';



Choose Payment Page
Auto select payment method.
http://forum.virtuemart.net/index.php?topic=108974


UPDATED::: still working
Code below will be for improvements while using the native "1 page checkout" 


To hide the payment form when a payment has already been set. It will also display the "edit payment" link

cart/default_pricelist.php
change this
<?php if (!empty($this->layoutName) && $this->layoutName == 'default') {
if (VmConfig::get('oncheckout_opc', 0))) {

to this
<?php if (!empty($this->layoutName) && $this->layoutName == 'default') {
if ((VmConfig::get('oncheckout_opc', 0))&& ($this->cart->cartData['paymentName'] == 'No payment selected')) {

I was getting problems with checking for billing address when default country is set.
So I wrote this function

<?php function valBT($items){
      foreach($items['fields'] as $item){
      if ($item['name']!='address_1') continue;
      if ($item['name']=='address_1' && !empty($item['value']) ){return true;}
      else return false;
      }} ?>

Then you can check if the billing is empty like this
<?php if (!valBT($this->cart->BTaddress)){ ?>This is when it is empty<?php }?>
& when it is not empty
<?php if (valBT($this->cart->BTaddress)){ ?>This is when billing is filled in <?php }?>

You can also use this native function to test if all is filled in, billing, shipment method, and payment method
<?php  if ($this->cart->getDataValidated()){ ?> This is when its all selected <?php }?>
or
<?php  if (!$this->cart->getDataValidated()){ ?> This is when it's missing something<?php }?>

Test if the billing & shipping address is the same
<?php if ($this->cart->ST==$this->cart->BT) { ?> This is when they are the same <?php } ?>

or if different
<?php if ($this->cart->ST!=$this->cart->BT) { ?> This is when they are the same <?php } ?>












Title: Re: Cart Page Fields & Modifications
Post by: Ffragrances on October 10, 2012, 04:29:37 am


You seem to have an excellent grasp on the PHP required to make very important corrections on the cart page. I would say this would cross over to just about any other page as well, as long as you  know what and where the "params" are. I was wondering if you might be kind enough to assist me with this one. I am just learning PHP and some Javascript, but slowly as I am very busy with many other things.

I have a test upgrade site that I am close to finishing in a sub directory while my old site runs live until I can finally get this one dialed in. Here is what I am trying to do.

I migrated the old site to the latest versions of both Joomla 2.5 and VM2. Server PHP 5.3+. I have purchased the USPS module that was developed by members of the VM team and it seems to be functioning well. I also setup, as I was advised to do, the generic shipping module for free shipping which also works, except that the customer still has too go to the select shipment page in order to select the Free Shipping option. In previous versions of VM the core setup under Shop Configuration had the option to set up free shipping and so no matter what modules you run, or how many (I have 3 total), the core would automatically halt the output of the other modules and auto select the Free Shipping option for the customer once they had purchased the correct preset amount of product. I will also have a copy of the generic shipping module setup just to list Local Pick or Delivery for my local customers in my zip code to select.

It seems that is not possible with the current version unless the output of all but the free module setup is running. So, the USPS module does not have a Max. dollar amount param. that you can set so the auto function will not work. So yes the customer can indeed go to the next page and select free shipping, but I would like to make it at least echo some text in the cart that their order now qualified for the free shipping, and if they would please go and select it, since I cannot set it to auto select until either the developers add that older function to VM2, or they add a max param. to the USPS module to stop it's output when that max is met, and leaving the other remaining module to be auto selected by VM2's core settings.

So essentially I need an IF "freeshipping" is active, echo or post the a message on the cart that their "Order Has Qualified for Free Shipping but need to select it", so as to cut back on any confusion and potential loss of business when people do not see the Free Shipping immediately and decide to just leave the cart and the site.

I have a basic understanding of what your code means and how it works but not exactly where or what "params" to use etc.. I thought you might be kind enough to share your more advanced knowledge and help a brother out... It never hurts to ask.

Current setup:

Shipping Modules;
(http://img1.UploadScreenshot.com/images/thumb/10/28212260480.png) (http://www.UploadScreenshot.com/image/1517631/7068405)

USPS Module Settings;
(http://img1.UploadScreenshot.com/images/thumb/10/28212333392.png) (http://www.UploadScreenshot.com/image/1517653/8127965)

Free Shipping Module Settings;
(http://img1.UploadScreenshot.com/images/thumb/10/28212384310.png) (http://www.UploadScreenshot.com/image/1517662/373719)

Current Cart Summary Output;
(http://img1.UploadScreenshot.com/images/thumb/10/28212471519.png) (http://www.UploadScreenshot.com/image/1517686/7926546)

What I would like to get until maybe someone fixes the core code or makes additional code changes to the plugins;
(http://img1.UploadScreenshot.com/images/thumb/10/28212583739.png) (http://www.UploadScreenshot.com/image/1517707/2506183)

Gave as much detail as I thought someone might need. Hopefully you or someone will be kind enough to assist or point me in the right direction to repair this missing setup feature form the older version of VM.

Thanks in advance, :)
Title: Re: Cart Page Fields & Modifications
Post by: PRO on October 10, 2012, 17:18:40 pm
<?php if ($this->cart->pricesUnformatted['salesPrice']>=60){echo 'Your Order Qualifies for Free Shipping';}?>
Title: Re: Cart Page Fields & Modifications
Post by: szbstvn on October 10, 2012, 17:59:09 pm
It s great!

I would like the BT and ST address add/mod on the cart page but without button! Only two form and the shoppers can save these data togheter with all page. This way maybe easier than click to buttons step the other page and back.

Somebody can help me?

Title: Re: Cart Page Fields & Modifications
Post by: Ffragrances on October 10, 2012, 23:45:05 pm
<?php if ($this->cart->pricesUnformatted['salesPrice']>=60){echo 'Your Order Qualifies for Free Shipping';}?>

That is awesome, and worked great! Thank you so much. SO now I just have to get rid of that text once they have selected the Free Shipping. So far I have tried this, but I believe I am using it incorrectly:

I put this in the line below the code that you gave me to use...

<?php if ($this->cart->cartData['shipmentName']=='Free Shipping')echo str_replace("Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left."," ","Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left.") ?>

Of course it is not working.. LOL. Or should I use something like this in the default.php instead of the default_pricelist.php. I guess I am looking to scan the page for that string of text and remove it. I am trying to learn slowly. Working on this is helping me pick up on a few things. Especially when breaking down what code snippets you have provided. One day I will learn all of this.... :)

 I also tried this  to test but it of course does not work either. Obviously I am a bit off here.. hmmmm ...LOL

<?php
 $oldphrase = "Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left";
$newphrase = ("Test");
                if ($this->cart->cartData['shipmentName']=='Free Shipping') echo str_replace($oldphrase,$newphrase,$oldphrase) ?>
Title: Re: Cart Page Fields & Modifications
Post by: PRO on October 11, 2012, 14:11:54 pm
<?php if ($this->cart->pricesUnformatted['salesPrice']>=60){echo 'Your Order Qualifies for Free Shipping';}?>

That is awesome, and worked great! Thank you so much. SO now I just have to get rid of that text once they have selected the Free Shipping. So far I have tried this, but I believe I am using it incorrectly:

I put this in the line below the code that you gave me to use...

<?php if ($this->cart->cartData['shipmentName']=='Free Shipping')echo str_replace("Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left."," ","Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left.") ?>

Of course it is not working.. LOL. Or should I use something like this in the default.php instead of the default_pricelist.php. I guess I am looking to scan the page for that string of text and remove it. I am trying to learn slowly. Working on this is helping me pick up on a few things. Especially when breaking down what code snippets you have provided. One day I will learn all of this.... :)

 I also tried this  to test but it of course does not work either. Obviously I am a bit off here.. hmmmm ...LOL

<?php
 $oldphrase = "Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left";
$newphrase = ("Test");
                if ($this->cart->cartData['shipmentName']=='Free Shipping') echo str_replace($oldphrase,$newphrase,$oldphrase) ?>


I THINK

this will make it NOT display when they have selected it, and shipment fee is 0

<?php if (($this->cart->pricesUnformatted['salesPrice']>=60) && (!empty($this->cart->pricesUnformatted['salesPriceShipment']))){echo 'Your Order Qualifies for Free Shipping';}?>
Title: Re: Cart Page Fields & Modifications
Post by: Ffragrances on October 11, 2012, 17:10:32 pm
<?php if ($this->cart->pricesUnformatted['salesPrice']>=60){echo 'Your Order Qualifies for Free Shipping';}?>

That is awesome, and worked great! Thank you so much. SO now I just have to get rid of that text once they have selected the Free Shipping. So far I have tried this, but I believe I am using it incorrectly:

I put this in the line below the code that you gave me to use...

<?php if ($this->cart->cartData['shipmentName']=='Free Shipping')echo str_replace("Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left."," ","Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left.") ?>

Of course it is not working.. LOL. Or should I use something like this in the default.php instead of the default_pricelist.php. I guess I am looking to scan the page for that string of text and remove it. I am trying to learn slowly. Working on this is helping me pick up on a few things. Especially when breaking down what code snippets you have provided. One day I will learn all of this.... :)

 I also tried this  to test but it of course does not work either. Obviously I am a bit off here.. hmmmm ...LOL

<?php
 $oldphrase = "Your Order Qualifies for Free Shipping. Please Select Free Shipping using the link on the left";
$newphrase = ("Test");
                if ($this->cart->cartData['shipmentName']=='Free Shipping') echo str_replace($oldphrase,$newphrase,$oldphrase) ?>


I THINK

this will make it NOT display when they have selected it, and shipment fee is 0

<?php if (($this->cart->pricesUnformatted['salesPrice']>=60) && (!empty($this->cart->pricesUnformatted['salesPriceShipment']))){echo 'Your Order Qualifies for Free Shipping';}?>



Nope,, Hmmmm. Excellent attempt though. Would it help if I gave you a link to the site and page?

Well I have been using basic PHP as I could put it together, and yours which obviously works for most of this is structured differently. But excellent try, and I appreciate it very much. I am sure that you are very busy with many things. I am still learning of course but what Framework are we working in here? This is not covered in the basic tutorials and sets that I have been using to learn.. LOL. I am still trying to figure out the structure of your codes.... 

Alas the hunt continues for the proper instruction code..... LOL Thanks again for your assistance....
Title: Re: Cart Page Fields & Modifications
Post by: PRO on October 11, 2012, 21:37:51 pm
try this
<?php if (($this->cart->pricesUnformatted['salesPrice']>=60) && ($this->cart->pricesUnformatted['salesPriceShipment']<=1)){echo 'Your Order Qualifies for Free Shipping';}?>

or

<?php if (($this->cart->pricesUnformatted['salesPrice']>=60) && (empty($this->cart->pricesUnformatted['salesPriceShipment']))){echo 'Your Order Qualifies for Free Shipping';}?>
Title: Re: Cart Page Fields & Modifications
Post by: Ffragrances on October 12, 2012, 20:26:15 pm
try this
<?php if (($this->cart->pricesUnformatted['salesPrice']>=60) && ($this->cart->pricesUnformatted['salesPriceShipment']<=1)){echo 'Your Order Qualifies for Free Shipping';}?>

or

<?php if (($this->cart->pricesUnformatted['salesPrice']>=60) && (empty($this->cart->pricesUnformatted['salesPriceShipment']))){echo 'Your Order Qualifies for Free Shipping';}?>


Ok, well neither of these work either but, here is what I have noticed.

The second one adds the echo to the other echo you gave me the first time. SO on the screen you see two of them right next to each other. So, I put together this statement just to test and play around with.

<?php if ($this->cart->pricesUnformatted['salesPrice']>=60)
               {
               echo ('Your Order Qualifies for Free Shipping.');
               }
            elseif   ($this->cart->pricesUnformatted['salesPriceShipment']<=1)
               {
            echo ('This Is a Test');
               }
            else
               {
            echo ('nothing');
               }
               ?>

And here is what happens...

If the price is below $60 this returns " This is a Test"
Once the price hits >60 it returns "Your Order Qualifies for Free Shipping"
If you select Free Shipping from the shipment selection this also returns "Your Order Qualifies for Free Shipping"
And of course if I select a normal paid shipping method it also returns "Your Order Qualifies for Free Shipping"

Now If I change the quantities of product so that the price drops below the 60 and I select  a paid shipping option this returns "nothing"

SO. I am still working on this, and it seems that which ever one of these triggers first it sticks. Also I have been inserting all of these lines above these lines:

 <?php if ( VmConfig::get('show_tax')) { ?>
            <td align="right"><?php echo "<span  class='priceColor2'>".$this->currencyDisplay->createPriceDiv('shipmentTax','', $this->cart->pricesUnformatted['shipmentTax'],false)."</span>"; ?> </td>
                                <?php } ?>
            <td></td>
            <td align="right"><?php echo $this->currencyDisplay->createPriceDiv('salesPriceShipment','', $this->cart->pricesUnformatted['salesPriceShipment'],false); ?> </td>
      </tr>

Question, This last section of code defines the div 'salesPriceShipment'

Is it an issue that that gets defined after we are calling for it in your codes???

I do not know of course, I am still learning, but this does give me more of a clue as to how all of this stuff works.
Also, it seems that essentially both sides of the && are being satisfied and therefore it will return the string "Your Order Qualifies for Free Shipping", I believe because(and I could be wrong), an empty location at 'salesPriceShipment is the same as 0. Am I incorrect in that thinking?

Anyhow I very much appreciate your assistance so far, and I continue to learn and try to get something that can work. If what I said is correct we will not be able to use the
'salesPriceShipment' because the code returns the same. That is why I am wondering if we can use the shipment name of "Free Shipping" to trigger not showing so that it is from someplace different than 'salesPriceShipment".. Hope that makes sense...

Also, so I can be less of a burden on you and others, it would be greatly helpful to me if you could maybe explain if there is a way and how, that I can get all of the tags or variables from any of these pages to work with. ie. 'salesPriceShipment', 'shipmentName', etc......

Thanks again,

<<<<<Learning :)
Title: Re: Cart Page Fields & Modifications
Post by: PRO on October 12, 2012, 22:19:30 pm
You might can go by the ID

I just tested this on mine (you need to find out the ID of your free shipment)

 if ($this->cart->virtuemart_shipmentmethod_id==8)



and to get all the variables, AS LONG as you are NOT live


<?php print_r($this->cart)?>
Title: Re: Cart Page Fields & Modifications
Post by: Ffragrances on October 13, 2012, 04:01:23 am
You might can go by the ID

I just tested this on mine (you need to find out the ID of your free shipment)

 if ($this->cart->virtuemart_shipmentmethod_id==8)

and to get all the variables, AS LONG as you are NOT live

 <?php print_r($this->cart)?>


Ok, After all of that I am much more confident and learning more and more. Thanks so much Pro. Of course I would have been happy if the VM team would have just left that option from the earlier versions in there to begin with, but I would not be much closer to learning all of this, which is my ultimate goal anyhow. So this is the final code that worked and what it did. This will help for those customers we all get that sometimes get confused at the cart and give up. You can never make it too easy, or else risk loosing sales. Thanks again for your assistance Pro. I will try and not take too much of your time in the future. I am glad that there are a few of you around that don't mind helping those that truly want to learn.
:)

Code Snippet:

     <?php if (($this->cart->pricesUnformatted['salesPrice']>=60)&&(empty($this->cart->virtuemart_shipmentmethod_id)))
         {
         echo ('<< Your Order Qualifies for Free Shipping.Please Select Free Shipping Using The Link On The Left ');
         }
         elseif (($this->cart->virtuemart_shipmentmethod_id==3)&&($this->cart->pricesUnformatted['salesPrice']>=60))
         {
         echo (' ');
             }
     ?>

You may know of a way that does this in a shorter method or shorthand that saves more white space , but this works great. Now I move on to getting this site live..... and Learning More...................................................


Free Shipping Level Met
(http://img1.UploadScreenshot.com/images/thumb/10/28512161948.png) (http://www.UploadScreenshot.com/image/1530655/2370683)

After Customer Selects Free Shipping
(http://img1.UploadScreenshot.com/images/thumb/10/28512174955.png) (http://www.UploadScreenshot.com/image/1530656/7399023)

Thanks again for your assistance....




Title: Re: Cart Page Fields & Modifications
Post by: blacksheep on October 30, 2012, 14:45:20 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"



Sorry Pro, can you explain which code have to change in my cart default.php ?
I don't know PHP therefore need more details.
It' not that simple to me, for example I don't know how to move "save" button below the text after selecting shipping or payment methods. By default they're before the the text and it's not the best.
Many thanks
Title: Re: Cart Page Fields & Modifications
Post by: PRO on October 30, 2012, 17:52:24 pm
Yes, that's true. for usability, bottom is better

<div class="buttonBar-right">
<button class="<?php echo $buttonclass ?>" type="submit"><?php echo JText::_('COM_VIRTUEMART_SAVE'); ?></button>
     &nbsp;
<button class="<?php echo $buttonclass ?>" type="reset" onClick="window.location.href='<?php echo JRoute::_('index.php?option=com_virtuemart&view=cart'); ?>'" ><?php echo JText::_('COM_VIRTUEMART_CANCEL'); ?></button>
    </div>


RIGHT BEFORE
<input type="hidden" name="controller" value="cart" />
Title: Re: Cart Page Fields & Modifications
Post by: blacksheep on November 08, 2012, 13:56:43 pm
Thank you so much!
Title: Re: Cart Page Fields & Modifications
Post by: aeiweb on November 13, 2012, 19:51:42 pm
This is awesome!

THIS code will display the "Confirm order button" where you want it. ONLY when the billing & payment has been filled in
<?php if ((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') ){
 echo '<h1 class="bottom10 border" style="width:180px;">';
         echo $this->checkout_link_html;
         $text = JText::_('COM_VIRTUEMART_ORDER_CONFIRM_MNU');
         echo '</h1>';

}?>

So this code will replace the ORDER button once the billing and shipping addy are in? SO GOOD. However, for those of us that are less brilliant at PHP, where abouts could I put this code for it to do its thing?

Thanks so much!

Title: Re: Cart Page Fields & Modifications
Post by: PRO on November 13, 2012, 22:24:54 pm
views/cart/tmpl/default_pricelist.php

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

Title: Re: Cart Page Fields & Modifications
Post by: 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? 
Title: Re: Cart Page Fields & Modifications
Post by: PRO on January 03, 2013, 22:38:00 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


Title: Re: Cart Page Fields & Modifications
Post by: illPhever on January 04, 2013, 15:27:53 pm
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.
Title: Modifing th Registration form
Post by: prem prakash on January 08, 2013, 16:12:24 pm
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 .
Title: Re: Cart Page Fields & Modifications
Post by: servlet on March 14, 2013, 13:10:59 pm
Where can I see demo?
Title: Re: Cart Page Fields & Modifications
Post by: PRO on March 14, 2013, 13:29:51 pm
Where can I see demo?

what demo?
Title: Re: Cart Page Fields & Modifications
Post by: Maxim Pishnyak on March 15, 2013, 12:29:00 pm
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!!!"
Title: Re: Cart Page Fields & Modifications
Post by: 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
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 06, 2013, 18:26:56 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?
Title: Re: Cart Page Fields & Modifications
Post by: syntalk on April 07, 2013, 00:03:36 am
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!
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 19, 2013, 18:33:32 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!
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 19, 2013, 21:09:55 pm
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.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 19, 2013, 21:42:49 pm
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"
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 20, 2013, 19:37:17 pm
Can I please get a link to your website sir?
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 20, 2013, 22:04:21 pm
if you look in my signature, you can tell.

I do not link to my website from forums
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 20, 2013, 23:09:48 pm
Now I have a ton of questions. lol That's a vm 2 store?
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 20, 2013, 23:34:49 pm
Now I have a ton of questions. lol That's a vm 2 store?

yes
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 20, 2013, 23:56:27 pm
I love how you have the image swap for the info being put in. Did you fix the submit twice. I placed a bogus order with paypal and cancelled. :( Hope you don't mind. You should easily find my name. :)

Also the shipping estimate date and delivery is great. Is that a plugin or you put that in? I can't even really begin to think of the questions I have lol this is where typing lacks. Ill have to conduct a list or work on figuring some of it out.

you can see the site I work on most pollenranch.com I have tried some of your code and wish I could modify it some. such as
Code: [Select]
        <?php if (empty($this->cart->BT)){ ?>
<?php echo '<div id="address">We see that you are not logged in. Returning users please login below to continue.<br>New or Guest users - Click <a class="details btn" type="text/html" title="Billing Details" href="../register/editaddresscartBT"><i class="icon-edit"></i> Add/Edit Billing address information</a> to start the checkout process</div>'?>
<?php ?>
As you can see I had to hard code the link in. Could you provide me with the knowledge of how to add that link with the correct way to echo the url in there? I tried changing the
Code: [Select]
       <?php if (empty($this->cart->BT)){ ?>
<?php echo '<div id="address">' JText::_('We see that you are not logged in. Returning users please login below to continue.<br>New or Guest users - Click - <a class="details btn" type="text/html" title="Billing Details" href="' JRoute::_('correct link');'"><i class="icon-edit"></i> Add/Edit Billing address information</a> to start the checkout process.') . '</div>'?>
<?php ?>
among other changes. For started I am not sure of the url which I figure I might be able to find but then there is the fact that I cant get the link to work. It just blanks the cart page. :(

Also how did you get the google checkout to work? I never can find a working component. Not one that actually works that is.
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 21, 2013, 00:15:45 am
You can ignore the crap code. I was being very dense. I see how now and the link in your post.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 21, 2013, 00:44:04 am
I love how you have the image swap for the info being put in. Did you fix the submit twice.

the ONLY time you get the "submit twice"  is when you click "checkout"

IF, you do the links like I do

-> Billing Address
-> Payment method

The checkout button does not show up on my site UNTIL all details needed to place order are filled in.

Thats where you see "Place order now"

That is the checkout button

IF you look at the code I posted with steps.php

<?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 }?>

^^   redtext   makes the !   red

Then the
<?php if (!empty($this->cart->BT)){ ?><img alt="Attention" src="/images/green.png" /> Billing Address Completed<br/><?php }?>

green.png   is a green image of a checkmark
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 21, 2013, 02:43:05 am
LOL I figured a big portion of it out. I am sorry if you went and looked as there is code that stops the cart from loading empty added.

Can you answer how you got the shipping days like that with estimates? Also would you, could you please share how you got google chechout/merchant to work? Even if it is easy and I sound stupid. My searches have yielded nothing of use.
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 21, 2013, 03:14:18 am
I have ran into a little snag. If I select check out as guest the button doesn't load for them to confirm purchase.  I noticed on your site you have a link specific for guest. Mine is on one page. Does that matter?
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 21, 2013, 14:43:48 pm
LOL I figured a big portion of it out. I am sorry if you went and looked as there is code that stops the cart from loading empty added.

Can you answer how you got the shipping days like that with estimates? Also would you, could you please share how you got google chechout/merchant to work? Even if it is easy and I sound stupid. My searches have yielded nothing of use.

http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-payment-systems/8045

the shipping days

I star availability as a number

Like 3   the 3 means it takes 3 days to ship.

Then, the availability code, just takes the days to ship & adds 5 business days to it.

Its not exact, it would be the longest time normally. Because it takes 5 days to ship from east coat to west coast.

my checkout as a guest button uses javascript to HIDE the registration fields, that are not required when checking out as a guest
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 21, 2013, 20:05:14 pm
I wanna be your friend. lol

I am going to get the OSE thats for sure.

My true problem now is that the guest checkout wont show. I turned it off because if they selected checkout as guest it would save the info and go back to the cart and not show the button for finishing. Only if you registered or logged in. The task show complete though. :( Any ideas?
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 21, 2013, 21:08:32 pm
I wanna be your friend. lol

I am going to get the OSE thats for sure.

My true problem now is that the guest checkout wont show. I turned it off because if they selected checkout as guest it would save the info and go back to the cart and not show the button for finishing. Only if you registered or logged in. The task show complete though. :( Any ideas?

are you using a template override?
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 21, 2013, 21:58:18 pm
Yes. VP_Promart (of course with lots of modifications I think at this point)

Oh yeah. I took the code out that reloaded the cart if it was empty. I am not sure I like how it redirects as the link isn't dynamic.

I am going to google the php code to take todays date and add 3 days to it so I can simulate your shipping guestimate.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 22, 2013, 01:17:20 am


<?php
$daystoship= $this->product->product_availability;
$daystodelivery= $daystoship + 5;
$ship_date = date('md', strtotime(" + $daystoship Weekdays"));
$estimated_ship_date= $ship_date;
$delivery_date = date('md', strtotime("+ $daystodelivery Weekdays"));
$mo = substr($estimated_ship_date, 0, 2);
$da = substr($estimated_ship_date, 2, 2);
$dmo = substr($delivery_date, 0, 2);
$dda = substr($delivery_date, 2, 2);
$est = $mo . "/" . $da;
$estd = $dmo . "/" . $dda;
?>


<?php echo $est; ?>
<?php echo $estd; ?>

$est     is estimated ship
$estd   is estimated days to delivery


Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 22, 2013, 18:01:29 pm
I had to add the damn button back to the bottom. Do you have any advice on how to skip the TOS. I tried to disable it even on the stock vm and the damn check still shows and it gives an error that the TOS was not checked. :(

THANK YOU for the date code. Being I use an image for shipping time I will just have to modify it with a solid number. :)
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 22, 2013, 18:21:35 pm
How strange that it is not getting today's date for the ship date. I changed it and I didn't see that it affected the date. Ideas?
 
Code: [Select]
                        <?php
                        $daystoship
== 1;
$daystodelivery$daystoship 3;
$ship_date date('md'strtotime(" + $daystoship Weekdays"));
$estimated_ship_date$ship_date;
$delivery_date date('md'strtotime("+ $daystodelivery Weekdays"));
$mo substr($estimated_ship_date02);
$da substr($estimated_ship_date22);
$dmo substr($delivery_date02);
$dda substr($delivery_date22);
$est $mo "/" $da;
$estd $dmo "/" $dda;

?>

<p align="center">Ship Date<br/><?php echo $est?></p>
<p align="center">Est Arrival Date<br/><?php echo $estd?></p>
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 22, 2013, 19:19:49 pm
I had to add the damn button back to the bottom. Do you have any advice on how to skip the TOS. I tried to disable it even on the stock vm and the damn check still shows and it gives an error that the TOS was not checked. :(

THANK YOU for the date code. Being I use an image for shipping time I will just have to modify it with a solid number. :)

http://forum.virtuemart.net/index.php?topic=114617.0
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 22, 2013, 19:23:09 pm
$daystoship== 0;

have you tried?


Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 22, 2013, 20:03:31 pm
I get "Ship Date 12/31" for output of today's date.
The exact output is
Ship Date 12/31
- Estimated Arrival Date 04/25 for Orders placed within U.S.A. before 3 p. m. PST Today -
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 22, 2013, 21:21:27 pm
i just tried it an it works for me
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 22, 2013, 22:14:37 pm
I am not having the best of days. It wont load todays date. My php is seemly more and more piss poor. :( I hate Mondays too.

I have other issues to with the checkout button code. I think it is linked to the TOS in the long run.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 22, 2013, 22:31:01 pm
I am not having the best of days. It wont load todays date. My php is seemly more and more piss poor. :( I hate Mondays too.

I have other issues to with the checkout button code. I think it is linked to the TOS in the long run.

are you testing this locally?

that could be the problem.

OR, some other php setting is not correct
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 22, 2013, 22:39:29 pm
No. lol I am breaking rules and testing on a live site.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 22, 2013, 23:40:24 pm
if it ships today, you dont have to do the date.

Just the delivery date
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 22, 2013, 23:50:40 pm
I just wanted to be fancy. :P I also got the button to display for guest. I only am showing TOS on the cart page so the issue was when a person selected guest there was no TOS checked as per
Code: [Select]
<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )&& ($this->cart->tosAccepted))I just removed the check for TOS :) that fixed the button not showing for guest to checkout. Now I need to figure out why the templates button for the cart (the one in template) requires to be clicked 2 times. you finish putting in information all fields filled in > click Place My Order > and it saves "Checkout done, please confirm the order".  I think it should not care and just save and pass the information.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 23, 2013, 01:54:48 am
I just wanted to be fancy. :P I also got the button to display for guest. I only am showing TOS on the cart page so the issue was when a person selected guest there was no TOS checked as per
Code: [Select]
<?php if (((!empty($this->cart->BT))&& ($this->cart->cartData['paymentName'] != 'No payment selected') )&& ($this->cart->tosAccepted))I just removed the check for TOS :) that fixed the button not showing for guest to checkout. Now I need to figure out why the templates button for the cart (the one in template) requires to be clicked 2 times. you finish putting in information all fields filled in > click Place My Order > and it saves "Checkout done, please confirm the order".  I think it should not care and just save and pass the information.

like i said before, IF they click the LINKS for billing, & payment, & if you have shipment.

THEN, when they get back to the cart, they only have to push it once
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 23, 2013, 17:23:07 pm
Pro - on our site it does not seem to work that way and I do believe it is in lue of the TOS. If the TOS is not required then they just click and it is one time done deal. The TOS acts like it has to save and then you can check out. Thats why I want to completely do away with the TOS. Funny part is the TOS is on cart and not edit_address (well it can be shown on address) I need to override the one on cart and set it to true-hidden but as I said about my skills being bleh lately. :( I think if I get that done then I can include your tos check for the button as it would always be true.

Just so I am absolutely clear. Thank you very much sir, very very much. You have been one of the biggest helps to me. You have no idea.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on April 23, 2013, 18:18:21 pm
Pro - on our site it does not seem to work that way and I do believe it is in lue of the TOS. If the TOS is not required then they just click and it is one time done deal. The TOS acts like it has to save and then you can check out. Thats why I want to completely do away with the TOS. Funny part is the TOS is on cart and not edit_address (well it can be shown on address) I need to override the one on cart and set it to true-hidden but as I said about my skills being bleh lately. :( I think if I get that done then I can include your tos check for the button as it would always be true.

Just so I am absolutely clear. Thank you very much sir, very very much. You have been one of the biggest helps to me. You have no idea.


you just need to <input hidden>

FROM the billing address & then , remove the code on the cart page, thats all I did

Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on April 27, 2013, 01:03:43 am
I solved my problem if I didn't already say so. :) I disabled TOS in the Db, removed the code from the link you provided for TOS and on the page. This makes the page, aside from the forms, a one click deal. I also added a button with text to replace the TOS next to the pay now. This way the customer could not claim they didnt see it. On a phone it is first to be displayed above the button.
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 02, 2013, 19:32:05 pm
I was wondering. Is there any insight on how to load the fields for a user to input their details and save&submit upon checkout. Totally removing the need to separate windows to be loaded. I am aware of OPC extensions but Id rather just modify what I have than hope I get a working OPC. I have seriously made use of the code from you.

Also any inside on how I would make this check to see if the view is category too?
Code: [Select]
<?php if ($this->countModules('main-top') and JRequest::getCmd('view')!=='cart'): ?>. Maybe this?
Code: [Select]
<?php if ($this->countModules('moduleposition') and JRequest::getCmd('view')!=='cart') &&(view)!=='category'?>This code hides my selected modules from being visible on those pages. Currently the dynamic version is not working after clicking the save button on shipper or payment. :(
Title: Re: Cart Page Fields & Modifications
Post by: PRO on May 02, 2013, 22:32:48 pm
I was wondering. Is there any insight on how to load the fields for a user to input their details and save&submit upon checkout. Totally removing the need to separate windows to be loaded. I am aware of OPC extensions but Id rather just modify what I have than hope I get a working OPC. I have seriously made use of the code from you.

Also any inside on how I would make this check to see if the view is category too?
Code: [Select]
<?php if ($this->countModules('main-top') and JRequest::getCmd('view')!=='cart'): ?>. Maybe this?
Code: [Select]
<?php if ($this->countModules('moduleposition') and JRequest::getCmd('view')!=='cart') &&(view)!=='category'?>This code hides my selected modules from being visible on those pages. Currently the dynamic version is not working after clicking the save button on shipper or payment. :(


http://www.kaizenmediaworks.com/virtuemart-template-and-module-control

http://www.metamodpro.com/metamod/metamod-pro
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 02, 2013, 23:03:54 pm
My theme already has the ability to hide modules that was why I asked about the code. So I can have it check for cart & category for my left and right. There's a bug only on the checkout page when selecting the payment. The page refreshes and the side modules load. However! When I add the code to the other module positions they do not appear as it is in the template. I have metamod-pro already but this is just easier with it already built in. I have also tried to make a few other modifications to the cart but they are failing in one way or another.

I figured out a way to load the BT in the ST area and have them both display with different links and description. I just am not smart enough to figure out how to hide one if the other is present. Figured it out with your code to show the button for adding a ST if BT is present. Splendid.

Thank you though for replying again.
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 03, 2013, 17:53:15 pm
I said to have it check for category when I meant productdetails. This code is not working
Code: [Select]
<?php if ($this->countModules('moduleposition') and JRequest::getCmd('view')!=='cart' or ('view')!=='productdetails'): ?>
When I only use the
Code: [Select]
<?php if ($this->countModules('main-top') and JRequest::getCmd('view')!=='cart'): ?> it works perfect and removes modules from cart page based on a setting. However I need to have the or work so that it will also hide them on productdetails. I figure whatever I am missing is small as that code doesn't give any errors but doesn't do the or. I am so puzzled by this. The Virtueplanet team doesn't like how I am changing their template I guess as they argue instead of answer when I ask there.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on May 03, 2013, 20:28:08 pm
this works


                <?php if (($this->countModules('moduleposition')) && (JRequest::getVar('view')!='category') && (JRequest::getVar('view')!='cart') ){}
               
                ?>



Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 21, 2013, 23:11:21 pm
I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.
Title: Re: Cart Page Fields & Modifications
Post by: AH on May 22, 2013, 00:16:17 am
Do you have any idea how to add a validation on the ZIP code entry for BT and/or ST

Cannot fathom how to do this for VM2, have spent much time looking at in:-   administrator/components/com_virtueamart/models/userfields

I sorted all this out in VM 1.1   http://forum.virtuemart.net/index.php?topic=92466.msg361004#msg361004


Any help appreciated to set me in the right direction  :-[
Title: Re: Cart Page Fields & Modifications
Post by: PRO on May 22, 2013, 15:18:17 pm
I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.

WHAT?
Title: Re: Cart Page Fields & Modifications
Post by: PRO on May 22, 2013, 15:21:18 pm
Do you have any idea how to add a validation on the ZIP code entry for BT and/or ST

Cannot fathom how to do this for VM2, have spent much time looking at in:-   administrator/components/com_virtueamart/models/userfields

I sorted all this out in VM 1.1   http://forum.virtuemart.net/index.php?topic=92466.msg361004#msg361004


Any help appreciated to set me in the right direction  :-[

I do not sorry
Title: Re: Cart Page Fields & Modifications
Post by: AH on May 22, 2013, 15:49:54 pm
Oh no! Back to hours of searching through code  :'(
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 22, 2013, 17:35:33 pm
I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.

WHAT?
Sorry I read what I wrote and it is confusing.
I set default country in vm backend to 223 (USA) Now when someone goes to the cart there is, in the bt and st, the default country showing but the bt and st are not complete and I would like to not show the country until all the details have been submitted. I added text to make it more apparent. www.pollenranch.com/store/cart
Title: Re: Cart Page Fields & Modifications
Post by: PRO on May 22, 2013, 21:21:51 pm
I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.

WHAT?
Sorry I read what I wrote and it is confusing.
I set default country in vm backend to 223 (USA) Now when someone goes to the cart there is, in the bt and st, the default country showing but the bt and st are not complete and I would like to not show the country until all the details have been submitted. I added text to make it more apparent. www.pollenranch.com/store/cart

you can just NOT show it at all.

IF you look at the code below

this line
   if (($item['name']==='application' ) OR ($item['name']==='agreed') OR ($item['name']==='CommercialAddress') OR ($item['name']==='virtuemart_country_id')){continue;}

I skip application,agreed,CommercialAddress, and virtuemart_country_id


      <?php

      foreach($this->cart->BTaddress['fields'] as $item){
         if(!empty($item['value'])){
            if($item['name']==='agreed'){
               $item['value'] =  ($item['value']===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');
            }
            if (($item['name']==='application' ) OR ($item['name']==='agreed') OR ($item['name']==='CommercialAddress') OR ($item['name']==='virtuemart_country_id')){continue;}
            ?><?php //if (($item['name']==='phone_1' ) OR ($item['name']==='fax') OR ($item['name']==='virtuemart_country_id')) echo $item['title'] ?>
               <span class="values vm2<?php echo '-'.$item['name'] ?>" ><?php echo $this->escape($item['value']) ?></span>
               <?php //if ($item['name'] == 'address_1' and $item['name'] != 'middle_name' and $item['name'] != 'zip') { ?>
            <?php if ($item['name'] == 'address_1' OR $item['name'] == 'address_2' OR $item['name'] == 'phone_1' OR $item['name'] == 'last_name' OR $item['name'] == 'email' OR $item['name'] == 'company') { ?>
               <br class="clear" />
            <?php
            }
            if ($item['name'] == 'city') { ?>
               ,
            <?php
            }
         }
      } ?>
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 22, 2013, 21:35:06 pm
That's the default_pricelist.php right? Those values are not in my template override file.
Code: [Select]
foreach($this->cart->BTaddress['fields'] as $item){

if(!empty($item['value'])){

if($item['name']==='agreed'){

$item['value'] =  ($item['value']===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');

}

?><!-- span class="titles"><?php echo $item['title'?></span -->

<span class="values vm2<?php echo '-'.$item['name'?>" ><?php echo $this->escape($item['value']) ?></span>

<?php if ($item['name'] != 'title' and $item['name'] != 'first_name' and $item['name'] != 'middle_name' and $item['name'] != 'zip') { ?>

<br class="clear" />

<?php

}

}

Title: Re: Cart Page Fields & Modifications
Post by: PRO on May 23, 2013, 13:06:57 pm
are you talking about the values that I added to my file?


thats my file
Title: Re: Cart Page Fields & Modifications
Post by: Jumbo! on May 23, 2013, 20:05:39 pm
That's the default_pricelist.php right? Those values are not in my template override file.

These codes are also not is standard VirtueMart layout file. Check it yourself in components\com_virtuemart\views\cart\tmpl\default_pricelist.php

I am not sure how to accomplish your goal. But please understand PRO has suggested the change in his modified file which obviously not standard VirtueMart layout file so not in our template layout file.

PHP codes in our Template layout (default_pricelist.php) is exactly same as standard VirtueMart file. We have only played with the design part but not with the functionality.
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 23, 2013, 20:23:03 pm
These codes are also not is standard VirtueMart layout file. Check it yourself in components\com_virtuemart\views\cart\tmpl\default_pricelist.php
I see this now after looking
I am not sure how to accomplish your goal. But please understand PRO has suggested the change in his modified file which obviously not standard VirtueMart layout file so not in our template layout file.
I see that after his post. I had to check for myself.
PHP codes in our Template layout (default_pricelist.php) is exactly same as standard VirtueMart file. We have only played with the design part but not with the functionality.
Never said you did. I was seeking a solution for my particular desire and that's why I asked questions.
Title: Re: Cart Page Fields & Modifications
Post by: PRO on May 23, 2013, 21:28:44 pm
in the unmodified file


right before this

<span class="values vm2<?php echo '-' . $item['name'] ?>"><?php echo $this->escape ($item['value']) ?></span>


add this
   <?php if ($item['name']==='WHAT-YOU-WANT-TO-NOT-SHOW' ) {continue;} ?>


You do it both with the billing & shipping.

Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on May 23, 2013, 21:31:41 pm
in the unmodified file


right before this

<span class="values vm2<?php echo '-' . $item['name'] ?>"><?php echo $this->escape ($item['value']) ?></span>


add this
   <?php if ($item['name']==='WHAT-YOU-WANT-TO-NOT-SHOW' ) {continue;} ?>


You do it both with the billing & shipping.


You sir are awesome. I will check the change on test site. Thank you.
Title: Re: Cart Page Fields & Modifications
Post by: IntrepidClassChicken on May 27, 2013, 16:18:59 pm
Hi Folks,

The Cart page definitely needs an overhaul so I am very keen to implement some of these changes.

I am confused on some very basic information and I request to have it be made very simple. Please speak to me like I am 10 years old if that helps. I won't be offended.

Which file am I modifying?
Where is this file located?
Where is the modified file to be saved to?

I am guessing "default.php" in the "/public_html/components/com_virtuemart/views/cart/tmpl" folder???????
Seriously wasted like an hour just to find that file. Still not sure if it is the correct one. I read this whole thread forwards and backwards like three times looking for clues.

What code do I need to delete?
Where do I insert the code you speak of?

I've tried the "<?php include("steps.php"); ?>" code at both the top and the bottom of the above "default.php" file but all that does is put links from the "steps.php" file at the top or the bottom of the existing page. It doesn't actually change the way the rest of the page displays.

Other than any knowledge of PHP, what am I missing?


Also the layout of the columns in the cart is a mess. Which file and/or which bit of code spells out the layout?
It looks like a table is used but I couldn't see anything that looked like a table structure in the above "default.php" file.


Your help is VERY VERY much appreciated.
Title: Re: Cart Page Fields & Modifications
Post by: AH on May 28, 2013, 16:34:54 pm
To create an override

follow these basic instructions :- http://forum.virtuemart.net/index.php?topic=90935.0 (http://forum.virtuemart.net/index.php?topic=90935.0)

Do not just modify the views in the virtuemart folder, as these are likely to get overwritten when implementing an new release.

As for the specifics, you will have to read this post in more detail - If you are new to this, then I would suggest that you seek experienced help, as getting it wrong will screw up your cart.

You are in the correct place for the views - just that the cart is made up of more than one view so not just default.php
Title: Re: Cart Page Fields & Modifications
Post by: link2monib on June 14, 2013, 23:01:22 pm
Hi,

I am new to Virtuemart and seeking some help and tips from senior members on this forum.

My Case - I am using joomla 2.5 with virtuemart 2, and i want to have "Add/Edit billing information" form shown on cart page (checkout page) Rather having a button. I simply do not want my customers to go to another page to fill in their info and route back to cart/checkout page after saving the info.

I do not have login/registration activated on my website as i do not need it. Clients can simply add their desired product to cart and checkout after providing their billing and/or shipping info.

Secondly, how can i eliminate that 2 step checkout (checkout and then confirm order)? this really makes customers confused. Can this be done just in one step? i mean just with checkout out or confirm order button only?

my website is artimmix.com
Many Thanks
Title: Re: Cart Page Fields & Modifications
Post by: PRO on June 15, 2013, 01:21:54 am
you need to look for a 1 page checkout plugin, there are a few around
Title: Re: Cart Page Fields & Modifications
Post by: IntrepidClassChicken on June 20, 2013, 07:59:29 am
How safe would a third party plugin like that be?

Occurs to me that if someone was going to write a trojan bit of code to hijack your order feed, gleaming customer information and possibly even credit card information, this would be the exact kind of application they would install it into!!!

Developers if you are listening.... I strongly urge you to work on the user friendliness of the Cart page as a priority for the next version.
Title: Re: Cart Page Fields & Modifications
Post by: AH on June 20, 2013, 09:45:00 am
So beware of free templates!! and free open source products, hmmmmmmmmmmm  I feel your first point is not so helpful.  Also difficult to hide such a thing in PHP!

However your second point is well made. The checkout is slightly lame and falls well short of some ecommerce packages on the usability front

Those one page checkout guys use lots of java and are constantly getting nagged when it has conflicts - I, for one, have chosen to keep away froma plugin where my checkout process is involved.
Title: Re: Cart Page Fields & Modifications
Post by: IntrepidClassChicken on June 20, 2013, 13:12:54 pm
I am no expert but I imagine there would be a thousand ways to achieve a trojan entry into this open source environment :/

Risk minimisation being the goal here as risk elimination seems to be very difficult.
Title: Re: Cart Page Fields & Modifications
Post by: tmdonovan on June 20, 2013, 17:00:08 pm
My client was not happy with the new view-cart page that showed login, address, cart, etc. all on one page.  He wanted a multi-step process, so I tested the view-cart process and learned that if you simply click the CheckOut button on the view-cart page (with no customer login, BT or ST address, no payment or shipping method selected), VM will "walk" you through a few forms to gather the necessary information.  Only when all necessary info is entered, the CheckOut button changes to Confirm Purchase.  I looked into the cart's php code and learned this is controlled by the php variable $this->checkout_task.  This variable is set to "confirm" only when all necessary info has been entered.  So, I did a template override for the cart, and modified default.php and default_pricelist.php to display things like login, address, coupon code, payment/shipping ONLY WHEN $this->checkout_task = "confirm".  This works very nicely, my client likes it and because it's all done in a template override, it won't be overwritten when new VM 2 releases are installed.

Thank you PRO, I've used your posts to solve this and several other VM2 problems.
Title: Re: Cart Page Fields & Modifications
Post by: kathcatch on July 31, 2013, 14:10:33 pm
Hi everyone,
I'm making some slight modifications to my cart page (default_pricelist.php). I would like to display each of the product's availability (ie. whats displayed on the product page).

I can't seem to get it to work - do i need to call it in differently?
I've tried a number of things like:
<strong>Delivery timeframe:</strong> <?php echo $prow->product_availability ?>
<strong>Delivery timeframe:</strong><?php echo $this->product->product_availability; ?>

I know this will probably just spit out 24_hours.jpg etc, but its a start, and I can't seem to get it to even do that. It just can't seem to read it.

Can the cart template only read certain product elements?

Currently running: Joomla 2.5.9 and VM 2.0.20b

Any help will be much appreciated.
Title: Re: Cart Page Fields & Modifications
Post by: Maxim Pishnyak on July 31, 2013, 15:05:55 pm
Code: [Select]
echo $product->product_availability;?
Title: Re: Cart Page Fields & Modifications
Post by: PRO on July 31, 2013, 19:54:07 pm
NO, product_availability is not in the array

I have talked to milbo about this, it should be.

i think he plans to add it
Title: Re: Cart Page Fields & Modifications
Post by: Poseidone68 on September 16, 2013, 12:43:44 pm
My client was not happy with the new view-cart page that showed login, address, cart, etc. all on one page.  He wanted a multi-step process, so I tested the view-cart process and learned that if you simply click the CheckOut button on the view-cart page (with no customer login, BT or ST address, no payment or shipping method selected), VM will "walk" you through a few forms to gather the necessary information.  Only when all necessary info is entered, the CheckOut button changes to Confirm Purchase.  I looked into the cart's php code and learned this is controlled by the php variable $this->checkout_task.  This variable is set to "confirm" only when all necessary info has been entered.  So, I did a template override for the cart, and modified default.php and default_pricelist.php to display things like login, address, coupon code, payment/shipping ONLY WHEN $this->checkout_task = "confirm".  This works very nicely, my client likes it and because it's all done in a template override, it won't be overwritten when new VM 2 releases are installed.

Thank you PRO, I've used your posts to solve this and several other VM2 problems.
I need to split the process too. I was looking to manage it using the checkout_task variable, but as soon as it enter in the default.php page the variable is already set to confirm (in the configuration panel the "one page checkout" option is unchecked..)
I'm not very found in php, i'm helping a friend with a small shop. So, how can i make it work? Is it possible to have and example of a default.php to help me understand how to customize it?

Thanks
Title: Re: Cart Page Fields & Modifications
Post by: turoco on September 20, 2013, 10:04:36 am
My client was not happy with the new view-cart page that showed login, address, cart, etc. all on one page.  He wanted a multi-step process, so I tested the view-cart process and learned that if you simply click the CheckOut button on the view-cart page (with no customer login, BT or ST address, no payment or shipping method selected), VM will "walk" you through a few forms to gather the necessary information.  Only when all necessary info is entered, the CheckOut button changes to Confirm Purchase.  I looked into the cart's php code and learned this is controlled by the php variable $this->checkout_task.  This variable is set to "confirm" only when all necessary info has been entered.  So, I did a template override for the cart, and modified default.php and default_pricelist.php to display things like login, address, coupon code, payment/shipping ONLY WHEN $this->checkout_task = "confirm".  This works very nicely, my client likes it and because it's all done in a template override, it won't be overwritten when new VM 2 releases are installed.

Thank you PRO, I've used your posts to solve this and several other VM2 problems.
I need to split the process too. I was looking to manage it using the checkout_task variable, but as soon as it enter in the default.php page the variable is already set to confirm (in the configuration panel the "one page checkout" option is unchecked..)
I'm not very found in php, i'm helping a friend with a small shop. So, how can i make it work? Is it possible to have and example of a default.php to help me understand how to customize it?

Thanks

@tmdonovan, yes could you share your files and let us buy you a beer for the trouble. This standard VM checkout aint working for nobody.
Title: Re: Cart Page Fields & Modifications
Post by: AH on October 08, 2013, 18:30:15 pm
Hide the shipping selection until address is completed vm2.0.24

I am still working on the cart display.

With the new OPC option in the cart layout, All the available Shipping rates that your cart qualifies for are displayed.

This is fantastic news, unless you have multiple countries or zones etc that require an address to be completed, as the rates get displayed before entry of an address is finished.

So how to get the shipping rates hidden until address is complete - so simple!

Just create an override for com_virtuemart/views/cart/tmpl/cart/default_pricelist.php

At line 340 you should see where the shipping rates start:-

Code: [Select]
<tr class="sectiontableentry1" valign="top">
<?php if (!$this->cart->automaticSelectedShipment) { ?>


Just add an if if (!empty($this->cart->BT)) statement to surround the delivery code and the delivery option will not display until address details are completed

Here is the replacement code:-

Code: [Select]

<?php 
if (!empty($this->cart->BT)){
?>

<tr class="sectiontableentry1" valign="top">
<?php 
 if(!$this->cart->automaticSelectedShipment) { ?>


<?php /* <td colspan="2" align="right"><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING'); ?> </td> */ ?>
<td colspan="4" align="right">
<?php echo $this->cart->cartData['shipmentName']; ?>
<br/>
<?php



if (!empty($this->layoutName) && $this->layoutName == 'default' && !$this->cart->automaticSelectedShipment) {
if (VmConfig::get('oncheckout_opc'0)) {
$previouslayout $this->setLayout('select');
echo $this->loadTemplate('shipment');
$this->setLayout($previouslayout);
} else {
echo JHTML::_('link'JRoute::_('index.php?view=cart&task=edit_shipment'$this->useXHTML$this->useSSL), $this->select_shipment_text'class=""');
}
} else {
echo JText::('COM_VIRTUEMART_CART_SHIPPING');
}?>

</td>
<?php
} else {
?>

<td colspan="4" align="right">
<?php echo $this->cart->cartData['shipmentName']; ?>
</td>
<?php ?>

<?php if (VmConfig::get ('show_tax')) { ?>
<td align="right"><?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('shipmentTax'''$this->cart->pricesUnformatted['shipmentTax'], FALSE) . "</span>"?> </td>
<?php ?>
<td align="right"><?php if($this->cart->pricesUnformatted['salesPriceShipment'] < 0) echo $this->currencyDisplay->createPriceDiv ('salesPriceShipment'''$this->cart->pricesUnformatted['salesPriceShipment'], FALSE); ?></td>
<td align="right"><?php echo $this->currencyDisplay->createPriceDiv ('salesPriceShipment'''$this->cart->pricesUnformatted['salesPriceShipment'], FALSE); ?> </td>

</tr>
<?php
}
?>





You caould always add a line to display that "delivery options will be shown when address is complete" if you want to help out even further and hide this when they have done the address part.
I think I might do this myself  :)

Title: Re: Cart Page Fields & Modifications
Post by: jzdana on October 29, 2013, 10:20:16 am
Many thanks for your useful topic. I would like to show category path of product as a separated field right before product name in price list on the cart page. The problem is that the fields in loop(foreach) are called from table of 'products' in Database. How can I solve it? any help would be appreciated.
Title: Re: Cart Page Fields & Modifications
Post by: jzdana on October 30, 2013, 12:34:31 pm
No one has any idea?!
Title: Re: Cart Page Fields & Modifications
Post by: PRO on October 30, 2013, 16:33:04 pm
Many thanks for your useful topic. I would like to show category path of product as a separated field right before product name in price list on the cart page. The problem is that the fields in loop(foreach) are called from table of 'products' in Database. How can I solve it? any help would be appreciated.
I dont know about category path,
but category name & id could easily be done. It's in the array.

Atleast I know the category id is.
Title: Re: Cart Page Fields & Modifications
Post by: nhinzky on October 31, 2013, 08:43:30 am
Hi Guys,

I want to know how can I get the fields in shipping address from this line of code(below) from the edit_address_addshipto.php under this directory (/public_html/components/com_virtuemart/views/user/tmpl):

Code: [Select]
<?php echo $this->lists['shipTo'];
I want to get the how can I display the first_name, last_name, and etc instead of displaying it using the above code. Can you help me guys?

EDIT: This post also refers to the same issue : http://forum.virtuemart.net/index.php?topic=119904.msg408199#msg408199

Thank you.
Title: Re: Cart Page Fields & Modifications
Post by: Stonedfury on October 31, 2013, 16:50:43 pm
Here is the page that has the fields
http://forum.virtuemart.net/index.php?topic=119898.msg408244#msg408244
Title: Re: Cart Page Fields & Modifications
Post by: jzdana on November 01, 2013, 16:38:35 pm
Quote
I dont know about category path,
but category name & id could easily be done. It's in the array.

Atleast I know the category id is.

I would appreciate if you guide me how to show category name in the price list based on category id. I have tested some lines but without success.
Title: Re: Cart Page Fields & Modifications
Post by: siristru on January 03, 2014, 22:12:06 pm
Good topic. Let me share with you my method. Virtuemart 2 has solution already :D but you need to modify it a bit. So here is what you need:

4 php files from components/com_virtuemart/views/cart/tmpl

default.php
default_pricelist.php
select_payment.php
select_shipment.php

1 file from components/com_virtuemart/views/user/tmpl

edit_address.php

Copy them to templates/[your_template]/html/com_virtuemart/cart

And now lets start. File "default.php" shows shopping cart at start and at the end of ordering process. So find this lines:

Code: [Select]
<?php if (VmConfig::get ('oncheckout_show_steps'1) && $this->checkout_task === 'confirm') {
vmdebug ('checkout_task'$this->checkout_task);
echo '<div class="checkoutStep" id="checkoutStep4">' JText::('COM_VIRTUEMART_USER_FORM_CART_STEP4') . '</div>';
?>

Should be around 90 line.

As you can see it displays "checkoutStep4" that contains info about last, 4th step of order. Now lets change it a bit:

Code: [Select]
<?php if (VmConfig::get ('oncheckout_show_steps'1) && $this->checkout_task === 'confirm') {
vmdebug ('checkout_task'$this->checkout_task);
echo 'Here is step 4 so add html code with steps in div's with images that should be displayed on the end';
} else {
echo '
Here is step 1 so add html code with steps in div's with images that should be displayed on the beginning';
}
?>

You can add whatever you want and style it in your css.

Next thing is to handle 2nd step. In my case it's login/registration page.

We need to edit edit_address.php file. Copy it to templates/[your_template]/html/com_virtuemart/user.
In this file look for line:

Code: [Select]
<h1><?php echo $this->page_title ?></h1>
Now ad after it (or in any other suitable for you) place;

Code: [Select]
<?php if (empty($this->cart->BT)){ ?>
Here is step 2 so add html code with steps in div's with images that should be displayed on the 2nd step
<?php }?>

I used in this case PRO's solution - thanks!

Ok, now you need to modify select_shipment.php
Look for this code:

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
echo '<div class="checkoutStep" id="checkoutStep2">' . JText::_('COM_VIRTUEMART_USER_FORM_CART_STEP2') . '</div>';
}

And modify it to

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
echo 'Here is step 3 so add html code with steps in div's with images that should be displayed on the 3nd step';
}

Now modify file select_payment.php in this line:

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
    echo '<div class="checkoutStep" id="checkoutStep3">' . JText::_('COM_VIRTUEMART_USER_FORM_CART_STEP3') . '</div>';
}

Change it to:

Code: [Select]
if (VmConfig::get('oncheckout_show_steps', 1)) {
    echo 'Here is step 3 so add html code with steps in div's with images that should be displayed on the 3nd step';
}

My 5th step is confirmation of an order so we return to file default.php and apply changes just as I mentioned on beginning.

With bit of css styling it can look like mine:

(http://files.tinypic.pl/i/00486/i2skgl6fcx11_t.jpg) (http://www.tinypic.pl/i2skgl6fcx11)
(http://files.tinypic.pl/i/00486/klpa3wb0w2k7_t.jpg) (http://www.tinypic.pl/klpa3wb0w2k7)
(http://pics.tinypic.pl/i/00486/y84vi5ca9dat_t.jpg) (http://www.tinypic.pl/y84vi5ca9dat)
(http://pics.tinypic.pl/i/00486/q6c4luioitoj_t.jpg) (http://www.tinypic.pl/q6c4luioitoj)
(http://files.tinypic.pl/i/00486/jjfx220x1anx_t.jpg) (http://www.tinypic.pl/jjfx220x1anx)

Life example is here: http://kamizelkiodblaskowe.com.pl/koszyk.html (Shop is only in Polish, sorry ;) )

I attach my php files, icons and css style. I'm sure that you can do it much better than I ;) All you need is individual styling in css. I hope that I helped a bit ;)

[attachment cleanup by admin]
Title: Re: Cart Page Fields & Modifications
Post by: viperz on January 29, 2014, 11:09:55 am
I Insert
Code: [Select]
<?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 }?>
into my default.php (views/cart).


But it allways show "This shows AFTER the billing Address is completed " even if no address was filled.
 After filling the Billing adress it show "This shows AFTER the billing Address is completed "  again.


Sorry for my bad english... can somebody help me?

V 2.0
Title: Re: Cart Page Fields & Modifications
Post by: PRO on January 31, 2014, 11:08:27 am
I Insert
Code: [Select]
<?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 }?>
into my default.php (views/cart).


But it allways show "This shows AFTER the billing Address is completed " even if no address was filled.
 After filling the Billing adress it show "This shows AFTER the billing Address is completed "  again.


Sorry for my bad english... can somebody help me?

V 2.0



See the first post. at the bottom after "I was getting problems with checking for billing address when default country is set."
http://forum.virtuemart.net/index.php?topic=106459.0
Title: Re: Cart Page Fields & Modifications
Post by: Mole_LR on February 03, 2014, 19:40:23 pm
Hi!

How it's possible to "call" CustomField price into cart (so, instead of 1 Subtotal (ProductPrice), it could show:
ProductPrice: X
CustomFieldvalueprice (priceVariant): Y
Discounts...Taxes...etc...
Total: X + Y

?

Thank You!
Title: Re: Cart Page Fields & Modifications
Post by: J3DI13 on March 27, 2014, 12:42:20 pm
Hi There

How would i replace the 'Tax' & 'Discount' columns in the cart and replace it to uptput the 'cost ex vat' and 'vat'. As demonstrated in the image attached.

Your help would be greatly appreciated!

[attachment cleanup by admin]
Title: Re: Cart Page Fields & Modifications
Post by: J3DI13 on April 02, 2014, 09:58:35 am
Is there really no way of doing this?
Title: Re: Cart Page Fields & Modifications
Post by: AH on April 02, 2014, 11:56:24 am
Yes it is possible

You have to create a template override to the

Something like this for the headers

Code: [Select]
<tr>
<th align="left"><?php echo JText::('COM_VIRTUEMART_CART_NAME'?></th>
<th align="left"width="110px"><?php echo JText::('COM_VIRTUEMART_CART_SKU'?></th>
<th align="center" width="60px"><?php echo JText::('COM_VIRTUEMART_CART_PRICE'?></th>
<th align="center" width="90px"><?php echo JText::('COM_VIRTUEMART_CART_QUANTITY'?></th>
<?php if (VmConfig::get ('show_tax')) { ?>
<th align="center"><?php  echo "<span  class='priceColor2'>" JText::('COM_VIRTUEMART_CART_SUBTOTAL_TAX_AMOUNT') . '</span>' ?></th>
<?php ?>
<th align="center"><?php echo "<span  class='priceColor2'>" JText::('COM_VIRTUEMART_CART_SUBTOTAL_NET_AMOUNT') . '</span>' ?></th>
<th align="center"><?php echo JText::('COM_VIRTUEMART_CART_TOTAL'?></th>
</tr>


Then adjust your detail row

Code: [Select]
<td align="left" style="font-size:10px;"><?php  echo $prow->product_sku ?></td>
<td align="center">
<?php
// quorvia removed for clarity
// if (VmConfig::get ('checkout_show_origprice', 1) && $this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax'] != $this->cart->pricesUnformatted[$pkey]['priceWithoutTax']) {
// echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $this->cart->pricesUnformatted[$pkey], TRUE, FALSE) . '</span><br />';
// }
if ($this->cart->pricesUnformatted[$pkey]['discountedPriceWithoutTax']) {
echo $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE);
} else {
echo $this->currencyDisplay->createPriceDiv ('basePriceVariant'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE);
}
//  echo $prow->salesPrice ;
?>

</td>


And then your subtotal line needs some tax
Code: [Select]
<tr class="cart-subtotal">
<td colspan="4" align="right"><?php echo JText::('COM_VIRTUEMART_ORDER_PRINT_PRODUCT_PRICES_TOTAL'); ?></td>

<?php if (VmConfig::get ('show_tax')) { ?>
<td align="right"><?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('taxAmount'''$this->cart->pricesUnformattedFALSE) . "</span>" ?></td>
<?php ?>
<td align="right"><?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax'''$this->cart->pricesUnformattedFALSE) . "</span>" ?></td>
<td align="right"><?php echo                                 $this->currencyDisplay->createPriceDiv ('salesPrice'''$this->cart->pricesUnformattedFALSE?></td>
</tr>


And then you will want to have a total tax, which is not included in any variables and I just think that this was not considered by the Dev's to be useful, as all our customers love to calculate their own values  :o !

Code: [Select]
<tr class="cart-totals">
<td colspan="4"><?php echo JText::('COM_VIRTUEMART_CART_TOTAL'?></td>

<?php if (VmConfig::get ('show_tax')) { ?>
<td> <?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('billTaxAmount'''$this->cart->pricesUnformatted['billTaxAmount'], FALSE) . "</span>" ?> </td>
<?php }
    
//quorvia has to create a net amount for the cart
    
$billNet $this->cart->pricesUnformatted['billTotal'] - $this->cart->pricesUnformatted['billTaxAmount']; //quorvia new
    
?>


    <td> <?php echo "<span  class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('billNet'''$billNet FALSE) . "</span>" ?> </td>
<td><div class="bold"><?php echo $this->currencyDisplay->createPriceDiv ('billTotal'''$this->cart->pricesUnformatted['billTotal'], FALSE); ?></div></td>
</tr>[code]
[/code]


This might not be the exact format, but should get you started along the right path
Title: Re: Cart Page Fields & Modifications
Post by: J3DI13 on April 02, 2014, 13:20:33 pm
Thank you so much Hutson, the first bit of positive ive had for this issue. I will give it bash now, will let you know.

Again Thank You!
Title: Re: Cart Page Fields & Modifications
Post by: AH on April 02, 2014, 22:38:41 pm
 :)
Title: Re: Cart Page Fields & Modifications
Post by: J3DI13 on April 03, 2014, 08:39:27 am
Hi Hutson

I have added the code so kindly supplied by you but i see it only works when not in the override, which is weird maybe i am not doing the override properly. I have placed in my HTML folder of my template keeping the same file structure as the component or must i just place it open in the HTML folder? Anyway for now its not really important as i need to get the rest sorted out. I have attached an image of what the cart now looks like 1 query would be the 'net-total' header title looks funky, could it be a language file that is causing that? (Fixed this with the language file by adding in a new line)

I see now that VAT column is not displaying any VAT in the cart, would that be a config in the backend?



Many Thanks


[attachment cleanup by admin]
Title: Re: Cart Page Fields & Modifications
Post by: AH on April 03, 2014, 10:35:33 am
Yes you need to config the Show tax in cart in order to get tax to show and I think you also need to config the display of prices to show tax

<?php if (VmConfig::get ('show_tax')) { ?>

Code: [Select]
<?php if (VmConfig::get ('show_tax')) { ?>
<td align="right"><?php echo "<span class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('taxAmount'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE$prow->quantity) . "</span>" ?></td>
<?php ?>
<td align="right"><?php echo "<span class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE$prow->quantity) . "</span>" ?></td>
<td colspan="1" align="right">
<?php
// Quorvia no need for this rubbish!
//if (VmConfig::get ('checkout_show_origprice', 1) && !empty($this->cart->pricesUnformatted[$pkey]['basePriceWithTax']) && $this->cart->pricesUnformatted[$pkey]['basePriceWithTax'] != $this->cart->pricesUnformatted[$pkey]['salesPrice']) {
// echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceWithTax', '', $this->cart->pricesUnformatted[$pkey], TRUE, FALSE, $prow->quantity) . '</span><br />';
//}
//elseif (VmConfig::get ('checkout_show_origprice', 1) && empty($this->cart->pricesUnformatted[$pkey]['basePriceWithTax']) && $this->cart->pricesUnformatted[$pkey]['basePriceVariant'] != $this->cart->pricesUnformatted[$pkey]['salesPrice']) {
// echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $this->cart->pricesUnformatted[$pkey], TRUE, FALSE, $prow->quantity) . '</span><br />';
//}
echo $this->currencyDisplay->createPriceDiv ('salesPrice'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE$prow->quantity?>
</td>


You are not placing the override in the right place if it only functions if you hack the default views
They should be placed in:-

\templates\your template\html\com_virtuemart\cart\
Title: Re: Cart Page Fields & Modifications
Post by: J3DI13 on April 03, 2014, 10:51:22 am
Hi

I have 'Show Tax in Cart' selected in the backend and have added the code to config the display <?php if (VmConfig::get ('show_tax')) { ?> so this is what the VAT column code looks like....
Code: [Select]
<?php if (VmConfig::get ('show_tax')) { ?>
<th align="center"><?php echo "<span  class='priceColor2'>" JText::('COM_VIRTUEMART_CART_SUBTOTAL_NET_AMOUNT') . '</span>' ?></th>
<?php ?>


thanks
Title: Re: Cart Page Fields & Modifications
Post by: J3DI13 on April 03, 2014, 11:25:57 am
Ok so i have managed to get all the columns outputting a display, i am a bit worried that its not outputting the correct data tho. please see code for the VAT column below and jpeg attached.

Code: [Select]
<?php if (VmConfig::get ('show_tax')) { ?>
<th align="center"><?php echo "<span  class='priceColor2'>" JText::('COM_VIRTUEMART_CART_SUBTOTAL_NET_AMOUNT') . '</span>' ?></th>
<?php ?>


and the bottom  Vat row
Code: [Select]
<?php if (VmConfig::get ('show_tax')) { ?>
<td align="right"><?php echo "<span class='priceColor2'>" $this->currencyDisplay->createPriceDiv ('taxAmount'''$this->cart->pricesUnformatted[$pkey], FALSEFALSE$prow->quantity) . "</span>" ?></td>
    <?php ?>

[attachment cleanup by admin]
Title: Re: Cart Page Fields & Modifications
Post by: nmihos on May 04, 2014, 00:35:34 am
Hello,

I want to add a form to my cart, where a seller can fill some chaeckboxes for the customer and some notes. But i want this form to be shown only for admins and not for the other users (or to be accesible by shopper group). A good idea is to edit the shipment form, but how can i make this form to be viewable only by the sellers?
Title: Re: Cart Page Fields & Modifications
Post by: nmihos on May 04, 2014, 15:25:33 pm
I set my sellers into the Shopper Group Sellers. I made a payment method which i call Sales Method and it is available and default only for the Selleres. Now i want the Shipment Form to appear when this payment method is selected.
Title: Re: Cart Page Fields & Modifications
Post by: martian474 on May 26, 2014, 07:23:50 am
Hi Admin,

Please help me. I want to add option(radio button/ dropdown) on my cart page that will add additional value to the total price.
for example:

1. Free pick-up (No additional charge)
2. Two days delivery( Additional charge).


Thank you very much!
Title: Re: Cart Page Fields & Modifications
Post by: GJC Web Design on May 26, 2014, 10:50:29 am
This is your 3rd identical post for this question in 3 different topics - if you want to annoy the contributors your going the right way about it....
Title: Re: Cart Page Fields & Modifications
Post by: martian474 on June 20, 2014, 07:41:10 am
Hi,

I want the registered shopper can see the details and checkout only while the others will only see joomla login. Please help. Thanks




[attachment cleanup by admin]
Title: Re: Cart Page Fields & Modifications
Post by: AH on June 20, 2014, 10:13:52 am
martian

Create yourself an overrride to
components/com_virtuemart/views/cart/tmpl/default.php

Replace
Code: [Select]

<?php echo shopFunctionsF::getLoginForm ($this->cartFALSE);




With

Code: [Select]


<?php echo shopFunctionsF::getLoginForm ($this->cartFALSE);
// check to see if the user is logged in
    
if(empty($this->cart->user->_id)){
        
// Close the <div class="cart-view">
        
echo "</div>";
        return;  
//skip the rest of this template


    
}
Title: Re: Cart Page Fields & Modifications
Post by: KWinston on September 30, 2014, 23:11:02 pm
What an excellent thread!  I am trying to modify the Checkout Button in VM2.6.10/ Joomla 2.5.9.  I was directed to look for style.css. ut am having a tough time finding it. The modification my client wants is to remove it altogether and replace it with a button that links directly to BluePay. 

Thoughts?

Your insight is very much appreciated.  Thanks!
Title: Re: Cart Page Fields & Modifications
Post by: Alice67 on December 15, 2014, 19:49:45 pm
?php if ($this->cart->cartData['paymentName'] == 'No payment selected') {?> This shows when the payment has NOT been selected<?php }?>
Title: Re: Cart Page Fields & Modifications
Post by: bob@robertclinton.com on March 28, 2015, 20:46:30 pm
Is there some code that will allow the shopper to toggle shipping addresses if they have more than one entered?
Title: Re: Cart Page Fields & Modifications
Post by: AH on March 29, 2015, 11:41:10 am
that is already part of base functionality

what version are you using