Re: AutoFacebook [Support]
Quote:
Originally Posted by
jagge
Hi, I got this module to work but the product description in Facebook shows html-tags and strange characters instead of swedish å.ä.ö? Anyone ran into this before?
You can have a look for a solution here:
hxxp://stackoverflow.com/questions/1890854/how-to-replace-special-characters-with-the-ones-theyre-based-on-in-php
The necessary changes needs to be made in autofacebook module only.
I would give more help than this, but i don`t have the time.
Good luck!
Re: AutoFacebook [Support]
Quote:
Originally Posted by
jagge
Hi, I got this module to work but the product description in Facebook shows html-tags and strange characters instead of swedish å.ä.ö? Anyone ran into this before?
If you read older posts you'll find many solutions for this. I finaly converted my files and database to utf-8 and the module worked perfect with the description. :P
Re: AutoFacebook [Support]
Quote:
Originally Posted by
coopco
I would really like to display the Nett Price in facebook. The price that is displayed comes from price_sorter in the database, but the nett price is not stored in the database (or I can't find it).
I guess you need the total price with taxes :)
Just use replace with this
Code:
//$price = $products_price;
$price = $_POST['products_price_gross'];
Re: AutoFacebook [Support]
Does this delay the posting to FB or does it stop it altogether?
Re: AutoFacebook [Support]
Quote:
Originally Posted by
joannem
Does this delay the posting to FB or does it stop it altogether?
hi,
its just a switch so leave off when creating your product, once you finish doing what you are doing linking and metatags etc and ready to switch the product to instock while editing the product for instock also switch facebook to on, this should update your facebook,
also if you have a product on your site that you would like on facebook just edit product and switch facebook to on and this product will update to facebook
bn
Re: AutoFacebook [Support]
Yeah, it's not a bad idea, however, when I turn the product back on, I do it from the category list, I don't go back in to edit the product to turn it on, so this would be an extra step to take. Seems to me that there should be something in the code that could be changed or something added, so that it would automatically send it to FB when I activate it.
I just Jamie isn't checking this thread anymore, it's sad, because it's a really good mod, just needs a little improvement :(
Re: AutoFacebook [Support]
Quote:
Originally Posted by
joannem
Yeah, it's not a bad idea, however, when I turn the product back on, I do it from the category list, I don't go back in to edit the product to turn it on, so this would be an extra step to take. Seems to me that there should be something in the code that could be changed or something added, so that it would automatically send it to FB when I activate it.
I just Jamie isn't checking this thread anymore, it's sad, because it's a really good mod, just needs a little improvement :(
so every time you switch an item active it updates facebook with that product ?
is this what you are looking
bn
Re: AutoFacebook [Support]
That is EXACTLY what I'm looking for yayyyy someone understands me lol
I think it's in the categories.php file - it looks up the status of the product - now if there's a way to put that in with the auto FB code that would be awesome :)
Code:
// change the status of categories and products
zen_set_time_limit(600);
for ($i=0, $n=sizeof($categories); $i<$n; $i++) {
if ($_POST['categories_status'] == '1') {
$categories_status = '0';
$products_status = '0';
} else {
$categories_status = '1';
$products_status = '1';
}
Re: AutoFacebook [Support]
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
Re: AutoFacebook [Support]
It didn't work :(
Well first it was because the folders had to be in the same directory as the categories.php file, as they did in the updateproduct.php folder.
But then it didn't get posted to Facebook, and the red icon wouldn't change to green either :(
Thank you SO much for trying for me though, I really appreciate it :)