Forums / All Other Contributions/Addons / New Mod: Embed Products onto third Party Site

New Mod: Embed Products onto third Party Site

Locked

Views: 2,183

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Jan 2008, 6:24 AM
#1
systemagic avatar

systemagic

New Zenner

Join Date:
Jan 2008
Posts:
11
Plugin Contributions:
0

New Mod: Embed Products onto third Party Site

Hi All,

I have made this mod to embed products onto third party sites.

Ideally the 3rd party site will use file_get_contents or just file and read the output.

I have created a file embed.php and this is the code I have used:

  require('includes/application_top.php');


  $pID = zen_db_prepare_input($_REQUEST['products_id']);
  $product = $db->Execute("select * from products where products_id ='" . (int)$pID . "'");

while (!$product->EOF){
$image  = "<img src='http://********.com/shop/images/";
$image .= "{$product->fields['products_image']}' width=150/>";

$url  = "http://***********.com/shop/index.php?";
$url .= "main_page=product_info";
$url .= "&products_id={$product->fields['products_id']}";
$url .= "&action=add_product";


print "<form method='post' ";
print "action='$url'>\n";

print "$image\n";
print "<br />Price: $";
print sprintf("%.2f",$product->fields['products_price']);

print "<input type='hidden' name='cart_quantity' value=1>\n";

print "<input type='hidden' name='products_id' ";
print "value={$product->fields['products_id']}>\n";

print "<br /><input type='submit' name='submit' value='Buy Now!'>\n";
print "</form>";

break;
}

Any reviews, suggestions, critiques?

Thanks,

Leonard

27 Feb 2008, 11:02 PM
#2
andyii avatar

andyii

Zen Follower

Join Date:
Mar 2007
Posts:
153
Plugin Contributions:
0

Re: New Mod: Embed Products onto third Party Site

not sure how easy this is to implement.
if I put this file on each of the other sites and call it, it will then do as as I ask, but would need to be a constant update by each site.
would be nice if it was always updated and easy to manage for each of the other store owners, like in admin, and choosing which categories (1 or more), then submitting that to the main site.
So in Admin of a particular site, the owner could choose the categories and hit submit...

19 Apr 2008, 9:41 PM
#3
divaboutiques avatar

divaboutiques

Zen Follower

Join Date:
Feb 2007
Location:
Worldwide Web
Posts:
191
Plugin Contributions:
0

Re: New Mod: Embed Products onto third Party Site

Leonard-

Where will I be uploading this module, as I have been trying to find the right file to upload it into. Can you give some steps on how to do this for the zenners who are not php, website savy.

Instructions:
Upload this file to domain.ext/zen/cart/path/embed.php
Then execute http://www.domain.ext/zen/cart/path/embed.php?products_id=3

The instructions is the txt file states this above, but I don't know where to look first.

Diva Boutiques
www.divaboutiques.com