Changing PayPal Shopping Cart button price using CMS builder

4 posts by 2 authors in: Forums > CMS Builder
Last Post: November 8, 2011   (RSS)

Re: [jeffrenner] Changing PayPal Shopping Cart button price using CMS builder

Hi jeffrenner,

The quick answer is, "Absolutely" and easily.

There are a number of scenarios that this wouldfit into, and since I don't know your specifics, here's a generic approach.

In the multi-record editor that lists your items for sale, create a text field called Price. In the input validation area, restrict the input to numbers and a period only.

Assuming that you're using a foreach loop to list all the items that are for sale, in the button code, where the price itself is normally displayed, insert <?php echo $record['price'] ?>. If it's a detail page then use <?php echo $your_tableRecord['price'] ?>
You can find many more specific code snippets in my CMSB Cookbook http://www.thecmsbcookbook.com

Hope that gets you started.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Changing PayPal Shopping Cart button price using CMS builder

Thank you for your reply. I am not sure if that solution is workable since there are multiple items for sale on each detail page all with different prices. Here is the URL of the web page: http://windsorwhipworksartcenter.org/pages/ArtistBio.php

Below is the php and button code I am currently using on that page:
Thanks again. Jeff
<?php
$maxColumns = 2;
$columnCount = 0;
?>

<table>
<tr>
<?php foreach ($artistsRecord['pictures'] as $image): ?>

<td align="center" valign="top">
<a href="<?php echo $image['urlPath'] ?>" target="_blank"><img src = "<?php echo $image['thumbUrlPath'];?>" width = "<?php echo
$image['thumbWidth'];?>" height = "<?php echo $image['thumbHeight'];?>" alt =
"<?php echo $image['info1'];?>" style="color:#bba279;" border="1" /></a><br /><br/><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8Y9D8QMVVHH7S">
<input type="image" src="http://www.windsorwhipworksartcenter.org/images/artists/PayPalBuyButton.jpg" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form><?php echo $image['info1'] ?><br /><?php echo $image['info2'] ?><br /><?php echo $image['info3'] ?><br /><?php echo $image['info4'] ?><br /><?php echo $image['info5'] ?>






</td>

<?php if (++$columnCount % $maxColumns == 0): ?>
</tr>
<tr>
<?php endif ?>

<?php endforeach ?>

Re: [jeffrenner] Changing PayPal Shopping Cart button price using CMS builder

Hi jeffrenner ,

I'm assuming that all of the information about the item is stored in your PayPal account in the hosted_button_id value.

I store mine in the record itself and use the following in my foreach loop to show the purchase links:
<a href="https://www.paypal.com/cgi-bin/webscr?amount=<?php echo $record['print_price'] ?>&amp;business=<?php echo $record['paypal_e_mail_address'] ?>&amp;cpp_header_image=http://www.my_site.com/images/pp.png&amp;currency_code=USD&amp;lc=US&amp;add=1&amp;cmd=_cart&amp;no_shipping=0&amp;no_note=1&amp;bn%20value=PP-ShopCartBF&amp;item_name=<?php echo $record['paypal_description'] ?>&amp;shopping_url=http://www.my_site.com/gallery1.php&amp;alt=Buy%20a%20Print&amp;">Click To Purchase</a>

That said, could you use one of the item image's info fields to store the hosted_button_id value? And then call it with:
hosted_button_id" value="<?php echo $image['infoX'];?>"

Just a thought...

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php