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: [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 ?>