VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: tthdoc on December 30, 2011, 06:10:56 AM

Title: Add to Cart Modification..
Post by: tthdoc on December 30, 2011, 06:10:56 AM
I have only 1 product and the checkout process is a little bit of an overkill.  I have a button on the site that says buy it now.  This takes you to the product details page.  Is there a way to change the add to cart button to a direct link to the checkout cart instead of the popup that says to continue shopping or go to cart?

Thanks,
Doc
Title: Re: Add to Cart Modification..
Post by: PRO on December 30, 2011, 12:03:37 PM
yes, change the form action to J;;_route to the cart
Title: Re: Add to Cart Modification..
Post by: tthdoc on December 30, 2011, 13:13:47 PM
Thanks, but where is this option, I don't see it?
Title: Re: Add to Cart Modification..
Post by: PRO on December 30, 2011, 13:45:38 PM
in the product page template
http://forum.virtuemart.net/index.php?topic=90935.0
Title: Re: Add to Cart Modification..
Post by: tthdoc on December 30, 2011, 15:14:04 PM
Ok, my php knowledge is not that great, so if you could help, it would be appreciated.  First, let me make sure I am looking at the correct file.  Using Filezilla, I went to components/com_virtuemart/views/productdetails/tmpl.  If this is the correct file, I then did a search on "action".  One is in a section about reviews, so I the only other section is this:

<?php // Add To Cart Button
            if (!VmConfig::get('use_as_catalog',0)) { ?>
            <div class="addtocart-area">
               <form method="post" class="product js-recalculate" action="index.php"

If this is correct, then I assume I need to change "index.php" to something that takes me to the cart? Could you tell me what to change it to?

If this is totally wrong, could you point me in the right direction?
Thanks.
Doc
Title: Re: Add to Cart Modification..
Post by: PRO on December 30, 2011, 15:45:35 PM
add a product to the cart, and then go to the cart, then copy that url
Title: Re: Add to Cart Modification..
Post by: tthdoc on December 30, 2011, 16:34:53 PM
Ok, that seemed easy enough, but it did not work.  Here is what I did:

I copied default.php to myview.php and made the following change

Changed <form method="post" class="product js-recalculate" action="index.php" > to <form method="post" class="product js-recalculate" action="index.php/buy/virtuemart/cart" >

Went to the product page, and in the dropdown box Product Details Page, selected myview and saved.

Went back to the site, clicked add to cart, and no change.  So I went back and changed index to pindex and even post to prost to try and throw an error, but all still worked the same.  So I assume I must be working on the wrong file.  Any ideas?

Thanks,
Doc
Title: Re: Add to Cart Modification..
Post by: PRO on December 30, 2011, 16:52:53 PM
do a layout override
http://forum.virtuemart.net/index.php?topic=90935.0

put the default.php
in

YOUR_joomla-template/html/com_virtuemart/productdetails/default.php
Title: Re: Add to Cart Modification..
Post by: tthdoc on December 30, 2011, 18:23:53 PM
Nope, still no change.

Went to the following:
.../templates/jt002_j16/html/com_virtuemart/productdetails

In product details folder put the default.php file and modified it.  Went back, selected default, and tried again.  Nothing.  So went back to default.php in the above path and renamed it myview.  Went back to VM and now see myview listed under Product details page dropdown.  Select it and save.  Still no change when click add to cart, still pops up and asks.

Doc
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 02, 2012, 16:44:32 PM
Still waiting to hear back... Any ideas?

Doc
Title: Re: Add to Cart Modification..
Post by: PRO on January 02, 2012, 17:16:12 PM
I tried it and it did not work. It used to work like that.

I will have to look into it
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 05, 2012, 04:00:03 AM
Have you found anything?  I am trying to get this finished so the site can go live.

Thanks,
Doc
Title: Re: Add to Cart Modification..
Post by: PRO on January 05, 2012, 16:14:47 PM
I do not know
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 05, 2012, 19:34:05 PM
I will take it by your response that I will not find a solution to this.  I guess I will have to look into a different shopping cart option if no one else can help with a solution.  Thanks for your time.

Doc
Title: Re: Add to Cart Modification..
Post by: PRO on January 05, 2012, 19:53:14 PM
Quote from: tthdoc on January 05, 2012, 19:34:05 PM
I will take it by your response that I will not find a solution to this.  I guess I will have to look into a different shopping cart option if no one else can help with a solution.  Thanks for your time.

Doc

turn off "virtuemart product scripts" in vmart administrator

then change the form action of the add to cart form to this   index.php?option=com_virtuemart&view=cart
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 05, 2012, 21:41:30 PM
Almost...  turning off the script and changing the form action does in fact allow it to go right to cart, with no popup,  but the cart has no item or price in it, just an empty cart :(  I did notice in the balloon popup that appears where you turn off the script that "these scripts are required for the dynamic operation of the basket and price!".  So I guess this option will not work unfortunately.

Doc
Title: Re: Add to Cart Modification..
Post by: PRO on January 06, 2012, 14:57:36 PM

$button_cls = 'addtocart-button'; //$button_cls = 'addtocart_button';
      $button_name = 'addtocart'; //$button_cls = 'addtocart_button';
Title: Re: Add to Cart Modification..
Post by: Studio 42 on January 06, 2012, 15:16:41 PM
Banquet changing the button_cls and button_name in default.php here
$button_cls = 'addtocart-button'; //$button_cls = 'addtocart_button';
$button_name = 'addtocart'; //$button_cls = 'addtocart_button';

is only needed
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 06, 2012, 16:22:55 PM
Was this a discussion or solution?  I went to default.php and what you have here is what is in that file.  I thought you were suggesting to change something in the code, but now I am lost.  Could you clarify?

Thanks,
Doc
Title: Re: Add to Cart Modification..
Post by: PRO on January 06, 2012, 16:48:04 PM
$button_cls = 'addtocart-button';
$button_name = 'addtocart';


change the name , and the class

$button_cls = 'button-class';
$button_name = 'button-addtocart';
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 06, 2012, 18:51:53 PM
I changed it and still nothing shows up in the cart when I click add to cart.

Here is the section from components/com_virtuemart/views/productdetails/tmpl/default.php as it is now:


<?php // Add the button

         $button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO');
         //$button_cls = 'addtocart-button'; //$button_cls = 'addtocart_button';
         //$button_name = 'addtocart'; //$button_cls = 'addtocart_button';
         $button_cls = 'button-class';
         $button_name = 'button-addtocart';



Title: Re: Add to Cart Modification..
Post by: PRO on January 06, 2012, 19:52:03 PM
turn back on product scrips
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 06, 2012, 20:01:31 PM
Turned product scripts back on and the popup is back again  :(
Title: Re: Add to Cart Modification..
Post by: PRO on January 06, 2012, 20:34:30 PM
I got it to work 1 time by doing something to the java file , but then it never added to cart again. But went straight to the cart
Title: Re: Add to Cart Modification..
Post by: tthdoc on January 07, 2012, 03:04:46 AM
So are we back to square one with no solution, or is there a possibility of finding one still?
Title: Re: Add to Cart Modification..
Post by: acidbird on January 20, 2012, 10:44:26 AM
hi there!

any updates on this one? I also need to link my productpage directly to the cart or at least delete "continue shopping" button on popup...

thx in advance!
Title: Re: Add to Cart Modification..
Post by: boskoff on March 18, 2012, 10:32:29 AM
Yeap,

would be great to have a solution for this.
For VM 2.0.2 and J!2.5.x?

Cheers!
Title: Re: Add to Cart Modification..
Post by: adrian on March 20, 2012, 10:11:07 AM
worked for me ! after clicking on "add to cart" takes me straight to the checkout page, also got rid of SKU column and Discount column to simpilfy things even more