Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Ready to go live


Recommended Posts

I'm cutting it close to my go live date (15th) and just wanted to drop you folks a note.


The site's on http://shop.geobaby.com


Mods that have been added include


- Credit + Gift Voucher

- Login box

- Worldpay

- Custom Amazon mod for pulling in reviews

- Custom mod for allowing two street address lines

- New and featured products display randomized

- Custom mod to show different right / left colums on the first page

- Custom mod for showing reviews along with the products a la Amazon


Lemme know what you think. If anyone wants the amazon mod let me know, its extremely crude, but works and pulls down reviews etc into the shopping cart.


Thanks in advance for your comments. :)


Baby Books and DVDS shop for Hong Kong

Link to comment
Share on other sites

Great looking site, nice & clean. Your logo looks squashed though, and you have a huge expanse of white space to the right of it. Are you planning to use it for banners or something? If not, think about centring your logo.


Your amazon mod would be nice to see.

Link to comment
Share on other sites

Yes, I'll be adding product and promotional banners to the top of the store.


I've added a field called ASIN to the products table, this contains the Amazon ASIN, which is not always the same as an ISBN code.


Towards the top of the categories.php file I've got






These are class files from amazonlite.com


This code fragment pulls in the reviews


          if ($HTTP_GET_VARS['action'] == 'insert_product') {

           $insert_sql_data = array('products_date_added' => 'now()');

           $sql_data_array = tep_array_merge($sql_data_array, $insert_sql_data);

           tep_db_perform(TABLE_PRODUCTS, $sql_data_array);

           $products_id = tep_db_insert_id();

           tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . $products_id . "', '" . $current_category_id . "')");

//              echo $sql_data_array['asin'];

       // echo "Init Amazon API<br>";

//      flush();

       $amazonAPI = new AmazonAPI();

       $amazon = new AmazonLiteXMLParser($amazonAPI->asinSearch($sql_data_array['asin']));

       foreach($amazon->records as $ind => $arr) {

               if (is_array($arr['rating'])) {

//              $rating=digitToStars($arr['avgcustomerrating']);

               foreach ($arr['rating'] as $ind => $rate) {

                       if ($section<>'5') {

                       $review_rating = $rate;

                       } else {

                       $review_rating = $rate;


                       $summary = $arr[summary][$ind];

                       $comment = $arr[comment][$ind];

       //      now that product is inserted get the reviews and add them

                       tep_db_query("insert into " . TABLE_REVIEWS . " (products_id, customers_id, customers_name, reviews_rating, date_added) values ('" . $products_id . "', '0', '" . addslashes('From') . ' ' . addslashes('Amazon') . "', '" . $review_rating . "', now())");

               $insert_id = tep_db_insert_id();

               tep_db_query("insert into " . TABLE_REVIEWS_DESCRIPTION . " (reviews_id, languages_id, reviews_text) values ('" . $insert_id . "', '1', '" . $comment . "')");




         } elseif ($HTTP_GET_VARS['action'] == 'update_product') {


Later in the file for new products I've got the following.


  } elseif ($HTTP_GET_VARS['action'] == 'new_product_preview') {

   if ($HTTP_POST_VARS) {

     $pInfo = new objectInfo($HTTP_POST_VARS);

     $products_name = $HTTP_POST_VARS['products_name'];

     $products_description = $HTTP_POST_VARS['products_description'];

     $products_url = $HTTP_POST_VARS['products_url'];

// do all the ASIN stuff

       if ($HTTP_POST_VARS['products_asin']) {

       // we have an amazon ASIN

       $asin = $HTTP_POST_VARS['products_asin'];

       // echo "Init AmazonAPI<br>" . time() ."<br>";

       $amazonAPI = new AmazonAPI();

       $amazon = new AmazonLiteXMLParser($amazonAPI->asinSearch($asin));

       // echo "Back from API Search<br>       " . time() . "<br>";

       if (is_array($amazon->records)) {

        echo "we have a valid record";

       // we have a valid amazon record

       // Get the various items

       foreach($amazon->records as $ind => $arr) {

//      print_r($arr);

       $a_product_name = $arr[productname];

       $a_releasedate = $arr[releasedate];

       $listprice = substr($arr[listprice],1) * 7.8;

       $a_price = ceil($listprice);

       $HTTP_POST_VARS['products_price'] = $a_price;

       if ($arr[media] == 'DVD') {

       $mpaa = $arr[mpaarating];





Example of how we pull the records in -- you only have to type in the ASIN and it pulls in the listprice etc from Amazon.


down the line I've got


        if (isset($arr['imageurlmedium'])) {

       $src = $arr['imageurlmedium'];


       $dst = "/home2/geobaby/www/shop/images/" . $arr['asin'].($is[2]==1?'.gif':($is[2]==2?'.jpg':'.other'));

       $products_image_name = $arr['asin'].($is[2]==1?'.gif':($is[2]==2?'.jpg':'.other'));

               if (!file_exists($dst)) {

               $f=fopen($src,'r'); $img=fread($f,'50000'); fclose($f);         #read max 50k image

               $f=fopen($dst,'w'); fwrite($f,$img); fclose($f);                        #write to local file




Which pulls in the appropriate image from Amazon.


I must caution people about the legality of what we're doing. We've email Amazon and have asked them if this is ok and within the terms of their affiliate program. No response yet. I expect them to respond by the end of the week.







Baby Books and DVDS shop for Hong Kong

Link to comment
Share on other sites



don't you bother the wrong corner in the Featureed Products Box? I tried to change it and it works




Line 37


I changed this

$num ++; if ($num == 1) { new contentBoxHeading($info_box_contents); }


to this

$num ++; if ($num == 1) { new infoBoxHeading($info_box_contents, false, false); }


false is without, true is with corner.




Still fighting with the problem that the featured products only shows up when I am logged in.



Link to comment
Share on other sites


1. it's too deep for my taste

2. the buttons don't all match. some are light blue, some are darer, standard osc buttons.

3. Seem to be missing top left corners in Featured products, categories.

4. You have Available options on several products that have only 1 option. like Binding shows "hardback" only. and Region lists "Region 1" only.

5. too much white space in the header.


otherwise very usable.

Link to comment
Share on other sites

Since you don't have a larger picture than the one with your product description, you can get rid of the 'click to enlarge' link.


Isn't it funny how you can be doing something totally unrelated when you stumble accross the answer to a problem that's been dogging you? I've been hunting for where to alter the corner gifs on the featured products box. Thanks Devon :wink:

Link to comment
Share on other sites

-Way too much going on. Where do I start?

- Why four columns?

- Your default page is huge!

- Featured products "button_in_cart" should be valigned "bottom".

- Why display categories that have no products?


Looks like quality stuff though. Good luck!

Link to comment
Share on other sites

  • 2 months later...

I'm very very very interested in your mod for amazon. I'm interested in sale books from amazon. Please could you explain me what must I do?


Thank you and congratulation for your wonderful web site.


Juan Carlos

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...