a small paypal shop
5 posts by 2 authors in: Forums > CMS Builder
Last Post: March 27, 2008 (RSS)
By soj - March 26, 2008 - edited: March 27, 2008
I'm stuck and hoping for some help on two questions.
First, I'm using the Products menu to try and make a little paypal shop. I've got a some sample product content created. On my template, I've placed the php code into a table, image over text. This displays product records in one column. I'd like two or three columns. How might I accomplish this?
Next, what is the best to insert a paypal button in place of the order url?
Thanks in advance!
soj
Re: [soj] a small paypal shop
By Dave - March 26, 2008
Next, when you'll look at your design there will be some kind of pattern in the HTML. You'll probably want to insert something every 3 records. Here's some code that keeps count and does that:
<?php $maxCols=3; if (@++$count % $maxCols == 0): ?> <br/>
... content to insert here ...
<?php endif ?>
Depending on how you design your page, you might insert the end and beginning of a table there (</tr></table><table ...><tr>), the end and beginning of a row (</tr><tr>) or something else.
If you get stuck post an url for your mockup HTML and your viewer and I can give you a hand.
Next, for the paypal button... What is the exact paypal button code? If you can post the button code I can tell you how to create it with CMS Builder.
Hope that helps!
interactivetools.com
Re: [Dave] a small paypal shop
By soj - March 26, 2008 - edited: March 26, 2008
Here is url of the page containing viewer code and table(s)you requested.
http://74.54.199.50/~stormrep/shop3.php
If it would make it easier, I don't mind having both image and record text in one cell.
Hopefully this will help more than just me and make it well worth the time!
My client has not yet set up his paypal account, so we can drop that question for now.
Soj
Re: [soj] a small paypal shop
By Dave - March 27, 2008
<table border="1"><tr>
<?php foreach ($listRows as $record): ?>
<td>
num: <?php echo $record['num'] ?><br/>
Name: <?php echo $record['name'] ?><br/>
... etc ...
</td>
<?php $maxCols=3; if (@++$count % $maxCols == 0): ?> <br/>
</tr><tr>
<?php endif ?>
<?php endforeach ?>
</tr></table>
Try experimenting with that for a while and let me know if it makes sense or not.
Basically, we're creating a table ("<table><tr>") and printing each record in a <td>...record...</td> and then we're ending and starting a row every 3 records "</tr><tr>".
Let me know if you have any luck with that.
interactivetools.com
Re: [Dave] a small paypal shop
By soj - March 27, 2008
On to more happy coding.
soj