News:

Looking for documentation? Take a look on our wiki

Main Menu

Cart Page Fields & Modifications

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

Previous topic - Next topic

Stonedfury

Quote from: 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.


You sir are awesome. I will check the change on test site. Thank you.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

IntrepidClassChicken

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.

AH

To create an override

follow these basic instructions :- 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
Regards
A

Joomla 3.10.11
php 8.0

link2monib

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
Muneeb Elahi

PRO

you need to look for a 1 page checkout plugin, there are a few around

IntrepidClassChicken

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.

AH

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.
Regards
A

Joomla 3.10.11
php 8.0

IntrepidClassChicken

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.

tmdonovan

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.

kathcatch

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.

Maxim Pishnyak

echo $product->product_availability;
?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

PRO

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

Poseidone68

Quote from: 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.
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

turoco

Quote from: Poseidone68 on September 16, 2013, 12:43:44 PM
Quote from: 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.
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.

AH

#89
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:-

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



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

Regards
A

Joomla 3.10.11
php 8.0