Jump to content

How can I disable the stock Add to Cart prestashop button and leave the payment handling to PayPal


Recommended Posts

Yes! I'll add a simple text line to my terms and conditions, stating there'll be a combined shipping refund. My goal is not to miss all those customers, not willing to create accounts or input their address and name. SSL certificate is hard to install on multistore. I have another "vintage collectibles" store, both managed tru the same BO. Both domains are addon domains to my main and oldest one :) Sounds complicated? - Yes, it is :)))

 

We all learn from our mistakes, aren't we?

Edited by FountainPenMarket (see edit history)
Link to comment
Share on other sites

so, you can edit tpl files - and remove add to cart buttons from the code, AFAIK this is the only way to achieve your goal.

(catalog mode also hides add to cart button - but it will not work as you expect)

Link to comment
Share on other sites

Or there might be a simple solution - just to change button positions - allowing the eager ones to use PP and "SAVERS" to add more items and create accounts ?

Now I'm starting to seek info on how to change button positions :)

Any ideas?

Live edit? - probably not :(

Link to comment
Share on other sites

OK, here it is:

 

1. remove Add to cart button from product list, letting the visitor click on VIEW or the text link to the product page

2. on product page, Checkout with PayPal to stand out from the Add to Cart ( be more appealing :) better positioned, etc - preferable option, ) or just remove Add to Cart and let PP alone.

Link to comment
Share on other sites

Now I feel I'm on the right way. As long as there are others trying to achieve that. Look at what I just found:

 

Open product-list.tpl

Find code below and remove it:

{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}

<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$base_dir}cart.php?add&id;_product={$product.id_product|intval}&token;={$static_token}">{l s='Add to cart'}</a>

{else}

<span class="exclusive">{l s='Add to cart'}</span>

{/if}

p.s. Don't forget to backup your original file first just in case something goes wrong.

 

p.p.s. this technique is not tested by me and should be implemented with caution.

Link to comment
Share on other sites

I had found that on another website as well, I tried to do it but couldn't find a exact match, so I left it.

After you just mentioned it I had another look and found something very similar. I did delete that and now the add to cart button is gone on the Product List pages ONLY. When I visit the actual product page, add to cart is still there. At least I am one step closer now.

 

Maybe someone knows how to pull this off:

I believe that our issue would be resolved if we could keep the paypal module working while the shop is in catalog mode.

Link to comment
Share on other sites

Major breakthrough ;-)

 

I commented this out in the product.tpl

 

Line 431 - 441

 

 

<!-- {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}

<span class="exclusive">

<span></span>

{l s='Add to cart'}

</span>

{else}

<p id="add_to_cart" class="buttons_bottom_block">

<span></span>

<input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" />

</p>

{/if} -->

 

It seems to be working :-D (as in, add to cart button is gone and the check out with paypal button still works)

Edited by TechPros (see edit history)
  • Like 1
Link to comment
Share on other sites

What Prestashop version are you refer to? In my 1.5.4 the lines from 431 to 441 are totally different - here they are:

 

{if $product->ecotax != 0}

<p class="price-ecotax">{l s='Include'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if}</span> {l s='For green tax'}

{if $product->specificPrice AND $product->specificPrice.reduction}

<br />{l s='(not impacted by the discount)'}

{/if}

</p>

{/if}

{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}

{math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price}

<p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'htmlall':'UTF-8'}</p>

{/if}

 

I think it serves the discounts, but not sure ...

Link to comment
Share on other sites

PrestaShop™ 1.5.4.1

 

I never claimed to know what I am doing, I'm a fan of trial and error so, I just tried it.

 

(I did try to upgrade my PS from 1.5.3 using 1 click upgrade which I think was not 100% successfull, that could be the reason why our tpl files are not the same.

 

Any suggestions on how to remove the cart "logo / button" from the top of the page?

I unhooked it in Module positions and had a look in header.tpl but did not find a reference there.

Link to comment
Share on other sites

No need to delete text just put the text in this: <!-- "bla" --> (to "comment it out", same effect as deleting.)

 

<!-- THIS TEXT IS NOW INACTIVE -->

 

this is a smarty template, does the <!-- --> commenting method works in tpl files?

Link to comment
Share on other sites

Hi Vekia,

 

That's what I used and the "add to cart button" is gone.

Maybe you could help with removing the cart logo / button from the top of the page?

 

I already deleted it from Module positions but no joy.

 

By the way the site I am working on is www.photogiftshop.ie which uses one of your modules ;-)

Link to comment
Share on other sites

Works Great! Than you both. Now it's only one task left to do ...

 

Change the position of the checkout with paypal button to the place add to cart was :)

 

hello

May i know what comment method you use?

 

create somewhere in the global.css

 

#container_express_checkout {
position:absolute!important;
right:0px!important;
top:300px!important;
}

 

try to change the top:300px; param (decrease / increase) to put button exactly there, where you want

Link to comment
Share on other sites

Noticed that ...

 

about the code in globall.css - any place i want is safe to add it ? I'm thinking about /* positionnement paragraph

 

position is working almost fine ...

 

When product description is more than 2 lines, paypal button is placed over the text ...

Edited by FountainPenMarket (see edit history)
Link to comment
Share on other sites

You read my mind.

Positioning the paypal button too high causes it to be placed over the text where there is a longer item description. From what I've been reading on Call to Action buttons, there should be empty space around them. Both requirements are satisfied with lower PP button position. I agree it looks nicer near the price, but will wait until proper solution is proposed.

 

Managed to remove Add to Cart button from products list page.

Will go to sleep satisfied with the job done today - All credits go to you, of course :)

Greetings from Bulgaria, Peter

Link to comment
Share on other sites

okay, so tommorow you have to:

 

open the product.tpl file and move the:

{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}

to place, where you've got add to cart button before. Probably some css modification will be necessary, for now i don't know what exactly, we will try tommorow :-)

 

regards

Link to comment
Share on other sites

So here are the hooks one by one:

 

Product cancelled - 1 Module [This hook is called when you cancel a product in an order] (Technical name: actionProductCancel)

 

Display new elements in the Back Office, tab AdminOrder - 1 Module [This hook launches modules when the AdminOrder" tab is displayed in the Back Office"] (Technical name: displayAdminOrder)

 

Redirect during the order process - 1 Module [This hook redirects the user to the module instead of displaying payment modules] (Technical name: displayBeforePayment)

 

Product footer - 1 Module [This hook adds new blocks under the product's description] (Technical name: displayFooterProduct)

 

Pages header - 1 Module [This hook displays additional elements in the header of your pages] (Technical name: displayHeader)

 

Payment - 1 Module [This hook displays new elements on the payment page] (Technical name: displayPayment)

 

Payment return - 1 Module (Technical name: displayPaymentReturn)

 

Right column blocks - 1 Module [This hook displays new elements in the right-hand column] (Technical name: displayRightColumn)

 

Shopping cart - Additional button - 1 Module [This hook displays new action buttons within the shopping cart] (Technical name: displayShoppingCart)

Link to comment
Share on other sites

okay

 

i checked it, paypal fast checkout is attached to the productFooter hook, which mean that it's necessary to:

move the:

{if isset($HOOK_PRODUCT_FOOTER) && $HOOK_PRODUCT_FOOTER}{$HOOK_PRODUCT_FOOTER}{/if}

 

to place where you've got "add to cart" button

Link to comment
Share on other sites

You mean to cut and paste that part of code from its current place to the place commented add to cart code is?

 

Doing this interferes with the ADD This module position and messes it up when product has short description longer than 3 lines.

 

I think we should let it stay that way.

Edited by FountainPenMarket (see edit history)
Link to comment
Share on other sites

I guess on the morning things are always different :)

As always you are absolutely right: we need to move the checkout with PayPal button to the place Add to cart once was. Otherwise, there is a huge empty gap when browsing categories ... :(

 

I'll move the code you suggested, but I'm not sure what to do with the paypal.css - entering the code next to the commented add to cart button code results in a page error - product page never loads, product list acts the same.

 

Any ideas?

 

Regards, Peter

Link to comment
Share on other sites

Hi Vekia, sorry for not answering, I was out of town.

 

Now to the topic.

 

Moving the code positions paypal button near the item price. Wonder why not at the same place. PayPal is Bigger than add to cart button problem?

 

Still wonder what to do with the paypal.css file ?

 

An Idea ... is it possible to alter the add to cart code to show paypal instead? here's the code we commented:

 

{*{if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}

<span class="exclusive">

<span></span>

{l s='Add to cart'}

</span>

{else}

<p id="add_to_cart" class="buttons_bottom_block">

<span></span>

<input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" />

</p>

{/if}*}

 

and there will be no need to do anything else? Just a though :)

Edited by FountainPenMarket (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...