Changing PayPal Shopping Cart button price using CMS builder

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

I am working on a website that sells paintings. The client wants a PayPal shopping cart, using PayPal's Website Payments Standard.

Currently I have the page set up with an image uploader and part of the description is the price. I have a "Buy Now" PayPal button below the picture so that when a picture is added a new button is generated. the problem is its the exact same button.

Is there any way I can set the page up so that when the client uploads/adds a new picture in the CMS editor that the new buttons price will automatically change? Any help would be greatly appreciated. Thanks

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