hi,
this might work for you,
in your admin/categories.php around line 109
change
PHP Code:
case 'setflag':
if ( isset($_POST['flag']) && ($_POST['flag'] == '0') || ($_POST['flag'] == '1') ) {
if (isset($_GET['pID'])) {
zen_set_product_status($_GET['pID'], $_POST['flag']);
}
}
to
PHP Code:
case 'setflag':
if ( isset($_POST['flag']) && ($_POST['flag'] == '0') || ($_POST['flag'] == '1') ) {
if (isset($_GET['pID'])) {
zen_set_product_status($_GET['pID'], $_POST['flag']);
}
if ($_POST['flag'] == '1') {
if (empty($language)) $language = $_SESSION['languages_id'];
$products_id = $_GET['pID'];
$product_lookup = $db->Execute("select pd.products_name, p.products_image, pd.products_description, pc.categories_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc
where p.products_id ='" . $products_id . "'
and pd.products_id = p.products_id
and pd.language_id = '1'");
//$return_field = $product_lookup->fields['lookup_field'];
//return $return_field;
$app_id = "Your App_ID Here"; //given when you created app
$app_secret = "Your App Secret Code Here"; //given when you created app
$page_id = "Page ID Here"; //obtained from running facebook_authorization.php from your browser
$page_token = "Page Token Here"; //long number obtained from facebook_authorization.php
$store_name = "Your Store"; // store name i.e. "Mary's Car Shop", or "MikesCupcakes.com."
$store_url = 'http://www.yourdomain.com'; //path to your store without the trailing "/"
$cur = '$'; //change to your currency symbol($, €, £, ¥, etc.). Assumes symbol comes in front of numbers
$new_message = "New Product Added"; // change to whatever or leave the same. i.e "New Cupcake!"
// No Need to edit below here.
$prod_image = $store_url . "/images/" . $product_lookup->fields['products_image'];
$price = substr(zen_get_products_actual_price($products_id),0,-2);
$prod_url = $store_url . '/index.php?main_page=product_info&cPath=' . $product_lookup->fields['categories_id'] . '&products_id=' . $products_id;
$prod_name = $product_lookup->fields['products_name'];
//webelity.com changed this line below to strip html tags from descriptions (Facebook does not support standard html input on descriptions via api calls)
$prod_description = $product_lookup->fields['products_description'];
//webelity.com changed this line below to strip html tags from descriptions (Facebook does not support standard html input on descriptions via api calls)
$info_strip = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $prod_description);
$description_stripped = strip_tags($info_strip);
//webelity.com 1-15-2012 added check to insure length does not reach the 10,000 character limit on descriptions in facebook.
$charset = 'UTF-8';
$no_description = 0;
$length = 9996;
if(mb_strlen($description_stripped, $charset) > $length) {
$facebook_description = mb_substr($description_stripped, 0, $length, $charset) . '...';
}
elseif(mb_strlen($description_stripped, $charset) == $no_description)
{
$facebook_description = "No description provided for this product.";
}
else
{
$facebook_description = $description_stripped;
}
include_once './includes/modules/facebook/facebook.php';
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true, )
);
// webelity.com modfied currancy and price information and added facebook_description to lower array
$attachment = array(
'access_token' => $page_token,
'message' => $new_message . " - " . $prod_name,
'name' => $prod_name,
'link' => $prod_url,
'caption' => 'Price: ' . $cur . $price,
'description' => $facebook_description,
'picture' => $prod_image
);
try {
$status = $facebook->api($page_id.'/feed', 'post', $attachment);
$messageStack->add_session('Facebook was successfully updated!', 'success');
}
catch (FacebookApiException $fbe){
$fberror = $fbe->result['error']['message'];
$messageStack->add_session('Facebook Error: '.$fberror, 'error');
}
}
}
obviously adding your info to this code
bn
Bookmarks