 |

soj
User
Mar 26, 2008, 3:46 PM
Post #1 of 5
(412 views)
Shortcut
|
|
a small paypal shop
|
Can't Post
|
|
Hi all, 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
(This post was edited by soj on Mar 27, 2008, 12:12 PM)
|
|
|  |
 |

Dave
Staff
/ Moderator

Mar 26, 2008, 4:47 PM
Post #2 of 5
(410 views)
Shortcut
|
The first step is to create a plain HTML mockup of what you want it to look like. This saves a lot of time compared to figuring out the exact design and CMS at the same time. 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! Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

soj
User
Mar 26, 2008, 8:47 PM
Post #3 of 5
(406 views)
Shortcut
|
|
Re: [Dave] a small paypal shop
[In reply to]
|
Can't Post
|
|
Thanks so very much, Dave. I tried a several combos with no success. I'm uncertain just where to place the extra code you suggested and whether or not I need to duplicate the viewer code. 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
(This post was edited by soj on Mar 26, 2008, 8:49 PM)
|
|
|  |
 |

Dave
Staff
/ Moderator

Mar 27, 2008, 10:14 AM
Post #4 of 5
(385 views)
Shortcut
|
No problem. Try something like this:
<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. Dave Edis - Senior Developer interactivetools.com
|
|
|  |
 |

soj
User
Mar 27, 2008, 12:14 PM
Post #5 of 5
(376 views)
Shortcut
|
|
Re: [Dave] a small paypal shop
[In reply to]
|
Can't Post
|
|
Oh! Thank you! That helped tons. I've got it work now, after only a couple of tries. On to more happy coding. soj
|
|
|  |
|