News:

Support the VirtueMart project and become a member

Main Menu

Add to Cart Modification..

Started by tthdoc, December 30, 2011, 06:10:56 AM

Previous topic - Next topic

tthdoc

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

PRO

yes, change the form action to J;;_route to the cart

tthdoc

Thanks, but where is this option, I don't see it?

PRO


tthdoc

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

PRO

add a product to the cart, and then go to the cart, then copy that url

tthdoc

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

PRO

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

tthdoc

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

tthdoc

Still waiting to hear back... Any ideas?

Doc

PRO

I tried it and it did not work. It used to work like that.

I will have to look into it

tthdoc

Have you found anything?  I am trying to get this finished so the site can go live.

Thanks,
Doc

PRO


tthdoc

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

PRO

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