Announcement

  •  » Extensions
  •  » Adding custom "add to cart" buttons in Paypal plugin

#1 2013-02-20 02:10:35

narmansk8
Member
2013-02-16
24

Adding custom "add to cart" buttons in Paypal plugin

Is is possible to customize the "Add to cart" and "View Shopping Cart" in the paypal shopping cart plugin?

I would like to either like to use a custom image, such as a jpg or png, that will replace the current text or be able to change the current text such as changing or removing the current background color behind the text.

Thanks!

Offline

 

#2 2013-02-20 08:18:44

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6761

Re: Adding custom "add to cart" buttons in Paypal plugin

Hi :-)

You can only change original file

for change text go to folder plugins -> PayPalShoppingCart -> language -> 'your language' exemple en_UK for english

edit ' plugin.lang.php'

remplace
$lang['Add to cart'] = 'Add to cart';
by
$lang['Add to cart'] = 'as you want';

LOOK OUT
Changes will be lost at each update plugin   

---------------------------
if you want change text by picture go to folder plugins -> PayPalShoppingCart -> edit 'main.inc.php' and Search 'Add to cart' for change


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2013-02-20 09:14:55

narmansk8
Member
2013-02-16
24

Re: Adding custom "add to cart" buttons in Paypal plugin

When I search for "Add to Cart" in the 'main.inc.php' file I find it here:

Code:

unction ppppp_append_form($tpl_source, &$smarty){
 $pattern = '#<.*\"infoTable\".*>#';
 $replacement = '
  <tr>
   <td class="label">{\'Buy this picture\'|@translate}</td>
   <td>
    <form name="ppppp_form" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" onSubmit="javascript:pppppValid()">
     <input type="hidden" name="add" value="1">
     <input type="hidden" name="cmd" value="_cart">
     <input type="hidden" name="business" value="{$ppppp_e_mail}">
     <input type="hidden" name="item_name">
     <input type="hidden" name="no_shipping" value="2"><!-- shipping address mandatory -->
   <input type="hidden" name="handling_cart" value="{$ppppp_fixed_shipping}"> 
     <input type="hidden" name="currency_code" value="{$ppppp_currency}">
     <select name="amount">
    {foreach from=$ppppp_array_size item=ppppp_row_size}
      <option value="{$ppppp_row_size.price}">{$ppppp_row_size.size} : {$ppppp_row_size.price} {$ppppp_currency}</option>
    {/foreach}
     <input type="submit" value="{\'Add to cart\'|@translate}">
    </form>
   </td>
   <td>
    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
     <input type="hidden" name="cmd" value="_cart">
     <input type="hidden" name="business" value="{$ppppp_e_mail}">
     <input type="hidden" name="display" value="1">
     <input type="hidden" name="no_shipping" value="2">
     <input type=submit value="{\'View Shopping Cart\'|@translate}">
    </form>
   </td>
  </tr>

Can I add the attached image, a custom button,  to replace "Add to Cart" text and still function properly?


Uploaded Images

Offline

 

#4 2013-02-20 09:37:41

narmansk8
Member
2013-02-16
24

Re: Adding custom "add to cart" buttons in Paypal plugin

I tried replacing

Code:

<input type="submit" value="{\'Add to cart\'|@translate}">

with

Code:

<input type="image" src="http://lavalight.thesierralight.com/lavalightgallery/PayPalShoppingCart/addcart.png" alt="submit">

but that didnt change anything.

Offline

 

#5 2013-02-20 10:05:44

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6761

Re: Adding custom "add to cart" buttons in Paypal plugin

Hi :-)

have you purge cache and template compile ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#6 2013-02-20 18:55:26

narmansk8
Member
2013-02-16
24

Re: Adding custom "add to cart" buttons in Paypal plugin

Purging the compiled templates worked and now the custom buttons are showing and functioning, but now the alignment is off and they are not displaying properly vertically. The Add to cart button is higher than the view shopping cart button. See attached link and image.

http://lavalight.thesierralight.com/lav … category/2


Uploaded Images

Offline

 

#7 2014-04-29 15:37:30

sport
Member
2014-03-16
93

Re: Adding custom "add to cart" buttons in Paypal plugin

narmansk8 i see that you have fixt it, how did you do that?

Fixt, but to be honest i dont remember what i have done.
It was someting in the theme hr_os_xl-rules.css
Something with padding?

Last edited by sport (2014-04-29 22:40:06)

Offline

 
  •  » Extensions
  •  » Adding custom "add to cart" buttons in Paypal plugin

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact