-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
shenk
I have also encountered the same situation as below:-
Status: array (
0 => '',
)
Fatal error: Uncaught CurlException: 7: couldn't connect to host thrown in /home/u170479066/public_html/facebook_authorization.php on line 600
Thanks for the details! It appears that this is a problem with your hosting company. It looks as though they may be blocking the ports needed for your site to connect to facebook. See this article: http://stackoverflow.com/questions/9...urlexception-7. You may want to hit up their tech support and see if there's anything they can do to enable the connection.
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
jamielife
Thanks for the details! It appears that this is a problem with your hosting company. It looks as though they may be blocking the ports needed for your site to connect to facebook. See this article:
http://stackoverflow.com/questions/9...urlexception-7. You may want to hit up their tech support and see if there's anything they can do to enable the connection.
thanks for your prompt response. will chech with the hosting company about this.
-
Re: AutoFacebook [Support]
This is a great mod. Just one thing, with the new version, if I put in '£' as the currency symbol, it outputs the symbol on facebook with a question mark in a diamond shape - �
Not sure if it is a charset issue, but I did alter that according to a guide. Any help is great, maybe other people are having the same issue. I am using GBP at the moment until I can figure it out lol.
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
HeathenMagic
This is a great mod. Just one thing, with the new version, if I put in '£' as the currency symbol, it outputs the symbol on facebook with a question mark in a diamond shape - �
Not sure if it is a charset issue, but I did alter that according to a guide. Any help is great, maybe other people are having the same issue. I am using GBP at the moment until I can figure it out lol.
Well darn, I thought I had figured it out. Unfortunately character encoding/charsets and all that isn't my area of expertise. I know when I set my charset to 'UTF-8 w/o BOM' as per the video I was able to see GBP, Euro, and the Yen. However maybe there's something else missing. What IDE are you using to change the encoding?
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
jamielife
Well darn, I thought I had figured it out. Unfortunately character encoding/charsets and all that isn't my area of expertise. I know when I set my charset to 'UTF-8 w/o BOM' as per the video I was able to see GBP, Euro, and the Yen. However maybe there's something else missing. What IDE are you using to change the encoding?
I had the same problem with Greek encoding so i just replaced the following line so that the Greek Description not to show.
'link' => $prod_url,
'caption' => 'Price: ' . $price . $cur,
'description' => 'Click for more details',
so i just suggest trying replacing the .$cur, with '£' so that it is like that
'caption' => 'Price: ' . $price '£',
-
Re: AutoFacebook [Support]
Hello Jamie, and Infogate,
Thanks for your replies. I am not sure what IDE, I am not very tech savvy. I did have a look what IDE is, but not sure if I am using them tools I found in the results. I can try Infogates solution. I did change Charset according to Dr Bytes guide (I think it was his).
James
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
HeathenMagic
Hello Jamie, and Infogate,
Thanks for your replies. I am not sure what IDE, I am not very tech savvy. I did have a look what IDE is, but not sure if I am using them tools I found in the results. I can try Infogates solution. I did change Charset according to Dr Bytes guide (I think it was his).
James
Basically it's what ever program you're using to open the files and make changes. You could always download the trial of webuilder if need be.
Infogate's solution might be something to try first. It should be mentioned though, that it should actually look like:
PHP Code:
'caption' => 'Price: ' . $price . '£',
-
Re: AutoFacebook [Support]
I have learnt something today Jamie, many thanks haha. I was using winmerge, but recently Beyond Compare to compare your files with mine. Thanks for telling me what it means.
-
Re: AutoFacebook [Support]
I have installed autofacebook and think it is working correctly. Anyways apparently this only works if you add the product yourself in admin. I have my products automatically updated daily vis inventory source. Anyways when it updates/adds new products those new products are not added to facebook because i did not manually add them. Is there a way to have this set up so that when my products are automatically added/updated on a daily basis update facebook at the same time?
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
jsuess
I have installed autofacebook and think it is working correctly. Anyways apparently this only works if you add the product yourself in admin. I have my products automatically updated daily vis inventory source. Anyways when it updates/adds new products those new products are not added to facebook because i did not manually add them. Is there a way to have this set up so that when my products are automatically added/updated on a daily basis update facebook at the same time?
I think that the tech team dealing with the inventory source has to deal with this. Using the "jamielife" source code i guess it would be easy for them to update the facebook as they managed to update the zen cart automatically.
-
Re: AutoFacebook [Support]
I love the software, thanks
But I have 2 questions:
Is it possible to link all the posts as a group post on Facebook.?
For example, If I load 20 products today on the website it would be great to be able to load all of them as a group post on facebook.
In addition
Is there a menu item that allows my admin login to turn on and off this feature.?
-
Re: AutoFacebook [Support]
I love the autofacebook addon. But when I enter a new product into zencart, and click on the 'insert' button it returns me to a blank screen. Just wondering what the problem may be?
I am running zencart 1.5.1.
-
Re: AutoFacebook [Support]
Is there any way I can get this addon to work with the canada post shipping module installed. One will disable the other.
-
Re: AutoFacebook [Support]
I just received an APP Alert from facebook for my APP. It says my Ap "needs to be updated for the February 2013 Breaking Changes.
Once your app is compliant, set the migration setting to "Enabled" in the Advanced section of the App Dashboard.
These changes will be permanently enabled for all apps in 1 day on Tuesday, February 5, 2013." HELP PLEASE!!! I have no clue what this means.
I am using zencart Version 1.5 and any help explaining what this means and what I need to do would be greatly appreciated. Thanks in advance
-
Re: AutoFacebook [Support]
Hi,
I will apologise first cause i am super new to all of this... i have been doing an install of zen cart for our shop and am slowly plodding through. I have got the shop working and mostly loaded now. I have a facebook page for the business and have installed autoFacebook to send updates to facebook... sadly nothing seems to be working for me. I have installed and uninstalled 3 times now in case i stuffed up somewhere and no joy... help please.
Zen cart is version 1.5.1
autofacebook 2.3
I have followed the video to the letter, even down to the update products as well as new products. When I add a new product or change a product my admin is not saying there has been an update to facebook. The facebook app is created and talking to me, as i have set the permissions, but i am now at a loss for what to do.
There is one nagging thought at the back of my head... i have installed a template for zen cart (picadilly posh) and maybe i should be installing to a different directory???
Thanx for any help in advance :-)
-
Re: AutoFacebook [Support]
just to let you know im un uk and using the £ sign, using your tip to change the encoding in your video worked perfect for me
Thanks Great Mod
bn
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
DJLQD
I love the autofacebook addon. But when I enter a new product into zencart, and click on the 'insert' button it returns me to a blank screen. Just wondering what the problem may be?
I am running zencart 1.5.1.
I get the same error, my error log shows
Code:
[08-Feb-2013 19:12:03] PHP Fatal error: Call to undefined function mb_strlen() in /chroot/home/azcomput/azcomputing.biz/html/azcomp/includes/modules/update_product.php on line 115
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
halogen.paul
Hi,
I will apologise first cause i am super new to all of this... i have been doing an install of zen cart for our shop and am slowly plodding through. I have got the shop working and mostly loaded now. I have a facebook page for the business and have installed autoFacebook to send updates to facebook... sadly nothing seems to be working for me. I have installed and uninstalled 3 times now in case i stuffed up somewhere and no joy... help please.
Zen cart is version 1.5.1
autofacebook 2.3
I have followed the video to the letter, even down to the update products as well as new products. When I add a new product or change a product my admin is not saying there has been an update to facebook. The facebook app is created and talking to me, as i have set the permissions, but i am now at a loss for what to do.
There is one nagging thought at the back of my head... i have installed a template for zen cart (picadilly posh) and maybe i should be installing to a different directory???
Thanx for any help in advance :-)
I have the same issue, ive installed 100's of mods over the years, I followed the video tutorial to the word, everything else seems to work except as above,
Doing my head in haha
HELP!!!!! :0)
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
AZComp
I get the same error, my error log shows
Code:
[08-Feb-2013 19:12:03] PHP Fatal error: Call to undefined function mb_strlen() in /chroot/home/azcomput/azcomputing.biz/html/azcomp/includes/modules/update_product.php on line 115
mb_strlen() is one of many multibyte functions that must be enabled in your server's PHP configuration. Talk to your hosting company to change your PHP configuration.
-
Re: AutoFacebook [Support]
In my opinion, the facebook_authorization.php file should be removed from the root directory of the store when installation has been completed.
If you are getting errors when you first run facebook_authorization.php, check with your hosting company to determine that the server is working as it should.
Great add on, just need to limit the price to two decimal places in facebook
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
halogen.paul
Hi,
I will apologise first cause i am super new to all of this... i have been doing an install of zen cart for our shop and am slowly plodding through. I have got the shop working and mostly loaded now. I have a facebook page for the business and have installed autoFacebook to send updates to facebook... sadly nothing seems to be working for me. I have installed and uninstalled 3 times now in case i stuffed up somewhere and no joy... help please.
Zen cart is version 1.5.1
autofacebook 2.3
I have followed the video to the letter, even down to the update products as well as new products. When I add a new product or change a product my admin is not saying there has been an update to facebook. The facebook app is created and talking to me, as i have set the permissions, but i am now at a loss for what to do.
There is one nagging thought at the back of my head... i have installed a template for zen cart (picadilly posh) and maybe i should be installing to a different directory???
Thanx for any help in advance :-)
Any thoughts or ideas on this little dilemma of mine yet?
-
Re: AutoFacebook [Support]
Jamie, is there a way to change when the fb page gets updated with the new product. When I insert a new product into my store, I have it set to out of stock until I'm totally finished linking and updating metatags etc. The mod posts it before I have set it to in stock. Not sure what code would work. Can you help?
Joanne
-
Re: AutoFacebook [Support]
Anyone? Jamie? I'd really like to have an answer to this question.
Joanne
-
Re: AutoFacebook [Support]
I looked at this but for a short time. The video instructions online are difficult to follow and even tougher for those of us with hearing issues. It would be nice if instructions were in writing.
-
Re: AutoFacebook [Support]
Hey Doug, there is an html file in the download that has the instructions printed in it - just double click on the html file and it should open in your browser :)
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
joannem
Jamie, is there a way to change when the fb page gets updated with the new product. When I insert a new product into my store, I have it set to out of stock until I'm totally finished linking and updating metatags etc. The mod posts it before I have set it to in stock. Not sure what code would work. Can you help?
Joanne
It would be cool to have the option on the admin product update page to turn autofacebook on or off for that update.
-
Re: AutoFacebook [Support]
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).
-
Re: AutoFacebook [Support]
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?
-
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).
hi i got this to work with the zen_get_products_actual_price($products_id) i did have to use the substring to get rid of the zeros
not sure what way this would work with taxes etc but give it a try
PHP Code:
$price = substr(zen_get_products_actual_price($products_id),0,-2);
bn
-
1 Attachment(s)
Re: AutoFacebook [Support]
Quote:
Originally Posted by
joannem
Jamie, is there a way to change when the fb page gets updated with the new product. When I insert a new product into my store, I have it set to out of stock until I'm totally finished linking and updating metatags etc. The mod posts it before I have set it to in stock. Not sure what code would work. Can you help?
Joanne
i have added a switch on a per product basis, this switch works either creating a new product or editing an existing product, it defaults to no everytime you edit or create a product warning you that it has changed to no if it was previously set to yes
Attachment 12049
ok here is what i done, few weeks ago but think this is everything
any experienced zenners out there could look at the code in case there is something not done properly
1. Backup your database
2. Backup YOUR ADMIN/includes/modules/update_product.php
3. Backup YOUR ADMIN/includes/modules/product/collect_info.php
1. back up database then run the following sql from your zcadmin
PHP Code:
ALTER TABLE products ADD products_update_social_media tinyint(1) NOT NULL default '0';
2. edit YOUR ADMIN/includes/modules/update_product.php (sample from v1.51)
find the following code
PHP Code:
$sql_data_array = array('products_quantity' => $products_quantity,
'products_type' => zen_db_prepare_input($_GET['product_type']),
'products_model' => zen_db_prepare_input($_POST['products_model']),
'products_price' => $products_price,
'products_date_available' => $products_date_available,
'products_weight' => $products_weight,
'products_status' => zen_db_prepare_input((int)$_POST['products_status']),
'products_virtual' => zen_db_prepare_input((int)$_POST['products_virtual']),
'products_tax_class_id' => zen_db_prepare_input((int)$_POST['products_tax_class_id']),
'manufacturers_id' => $manufacturers_id,
'products_quantity_order_min' => zen_db_prepare_input($_POST['products_quantity_order_min']),
'products_quantity_order_units' => zen_db_prepare_input($_POST['products_quantity_order_units']),
'products_priced_by_attribute' => zen_db_prepare_input($_POST['products_priced_by_attribute']),
'product_is_free' => zen_db_prepare_input((int)$_POST['product_is_free']),
'product_is_call' => zen_db_prepare_input((int)$_POST['product_is_call']),
'products_quantity_mixed' => zen_db_prepare_input($_POST['products_quantity_mixed']),
'product_is_always_free_shipping' => zen_db_prepare_input((int)$_POST['product_is_always_free_shipping']),
'products_qty_box_status' => zen_db_prepare_input($_POST['products_qty_box_status']),
'products_quantity_order_max' => zen_db_prepare_input($_POST['products_quantity_order_max']),
'products_sort_order' => (int)zen_db_prepare_input($_POST['products_sort_order']),
'products_discount_type' => zen_db_prepare_input($_POST['products_discount_type']),
'products_discount_type_from' => zen_db_prepare_input($_POST['products_discount_type_from']),
'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter'])
);
add the following code
PHP Code:
'products_update_social_media' => zen_db_prepare_input((int)$_POST['products_update_social_media']),
below
PHP Code:
'products_priced_by_attribute' => zen_db_prepare_input($_POST['products_priced_by_attribute']),
during your original install you added the following code to this file
PHP Code:
//AutoFacebook
$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/" . $_POST['products_image'];
$price = $products_price;
$prod_url = $store_url . '/index.php?main_page=product_info&cPath=' . $current_category_id . '&products_id=' . $products_id;
$prod_name = $_POST['products_name'][$_SESSION['languages_id']];
//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 = $_POST['products_description'][$_SESSION['languages_id']];
//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 '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');
}
we need to add our code here for switch so it will now look like this
PHP Code:
//AutoFacebook
if ($_POST['products_update_social_media'] == '1') {
$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/" . $_POST['products_image'];
$price = $products_price;
$prod_url = $store_url . '/index.php?main_page=product_info&cPath=' . $current_category_id . '&products_id=' . $products_id;
$prod_name = $_POST['products_name'][$_SESSION['languages_id']];
//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 = $_POST['products_description'][$_SESSION['languages_id']];
//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 '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');
}
}
so all i have done above is added
PHP Code:
if ($_POST['products_update_social_media'] == '1') {
to the start of your original autofacebook code and
to the end of your original autofacebook code.
remember the above complete code needs to be added in two sections of the ADMIN/includes/modules/update_product.php file
after
//// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////
and after
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
this means the switch works on both new products and updating product
3. edit YOUR ADMIN/includes/modules/product/collect_info.php
find
PHP Code:
$parameters = array('products_name' => '',
'products_description' => '',
'products_url' => '',
'products_id' => '',
'products_quantity' => '',
'products_model' => '',
'products_image' => '',
'products_price' => '',
'products_virtual' => DEFAULT_PRODUCT_PRODUCTS_VIRTUAL,
'products_weight' => '',
'products_date_added' => '',
'products_last_modified' => '',
'products_date_available' => '',
'products_status' => '',
'products_tax_class_id' => DEFAULT_PRODUCT_TAX_CLASS_ID,
'manufacturers_id' => '',
'products_quantity_order_min' => '',
'products_quantity_order_units' => '',
'products_priced_by_attribute' => '',
'product_is_free' => '',
'product_is_call' => '',
'products_quantity_mixed' => '',
'product_is_always_free_shipping' => DEFAULT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING,
'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS,
'products_quantity_order_max' => '0',
'products_sort_order' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
'products_price_sorter' => '0',
'master_categories_id' => ''
);
we are going to add
PHP Code:
'products_update_social_media' => '',
directly after
PHP Code:
'products_priced_by_attribute' => '',
your code should now look like
PHP Code:
$parameters = array('products_name' => '',
'products_description' => '',
'products_url' => '',
'products_id' => '',
'products_quantity' => '',
'products_model' => '',
'products_image' => '',
'products_price' => '',
'products_virtual' => DEFAULT_PRODUCT_PRODUCTS_VIRTUAL,
'products_weight' => '',
'products_date_added' => '',
'products_last_modified' => '',
'products_date_available' => '',
'products_status' => '',
'products_tax_class_id' => DEFAULT_PRODUCT_TAX_CLASS_ID,
'manufacturers_id' => '',
'products_quantity_order_min' => '',
'products_quantity_order_units' => '',
'products_priced_by_attribute' => '',
'products_update_social_media' => '',
'product_is_free' => '',
'product_is_call' => '',
'products_quantity_mixed' => '',
'product_is_always_free_shipping' => DEFAULT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING,
'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS,
'products_quantity_order_max' => '0',
'products_sort_order' => '0',
'products_discount_type' => '0',
'products_discount_type_from' => '0',
'products_price_sorter' => '0',
'master_categories_id' => ''
);
next find
PHP Code:
if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
p.products_id, p.products_quantity, p.products_model,
p.products_image, p.products_price, p.products_virtual, p.products_weight,
p.products_date_added, p.products_last_modified,
date_format(p.products_date_available, '%Y-%m-%d') as
products_date_available, p.products_status, p.products_tax_class_id,
p.manufacturers_id,
p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
p.product_is_free, p.product_is_call, p.products_quantity_mixed,
p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,
p.products_sort_order,
p.products_discount_type, p.products_discount_type_from,
p.products_price_sorter, p.master_categories_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = '" . (int)$_GET['pID'] . "'
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
and add
PHP Code:
p.products_update_social_media,
after
PHP Code:
p.products_priced_by_attribute,
your code should now look like this
PHP Code:
if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
p.products_id, p.products_quantity, p.products_model,
p.products_image, p.products_price, p.products_virtual, p.products_weight,
p.products_date_added, p.products_last_modified,
date_format(p.products_date_available, '%Y-%m-%d') as
products_date_available, p.products_status, p.products_tax_class_id,
p.manufacturers_id,
p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.products_update_social_media,
p.product_is_free, p.product_is_call, p.products_quantity_mixed,
p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,
p.products_sort_order,
p.products_discount_type, p.products_discount_type_from,
p.products_price_sorter, p.master_categories_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = '" . (int)$_GET['pID'] . "'
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'");
next find
PHP Code:
// Product is Priced by Attributes
if (!isset($pInfo->products_priced_by_attribute)) $pInfo->products_priced_by_attribute = '0';
switch ($pInfo->products_priced_by_attribute) {
case '0': $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true; break;
case '1': $is_products_priced_by_attribute = true; $not_products_priced_by_attribute = false; break;
default: $is_products_priced_by_attribute = false; $not_products_priced_by_attribute = true;
}
directly after add
PHP Code:
// Autofacebook
if (!isset($pInfo->products_update_social_media)) $pInfo->products_update_social_media = '0';
switch ($pInfo->products_update_social_media) {
case '0': $in_products_update_social_media = false; $out_products_update_social_media = true; break;
case '1': $in_products_update_social_media = false; $out_products_update_social_media = true; break;
default: $in_products_update_social_media = false; $out_products_update_social_media = true;
}
next find
PHP Code:
<tr>
<td class="main"><?php echo TEXT_SALEMAKER_ACTIVE; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_salemaker', '1', ($in_products_buynow_button==1)) . ' ' . TEXT_YES . ' ' . zen_draw_radio_field('products_salemaker', '0', ($in_products_salemaker==0)) . ' ' . TEXT_NO . ' ' . ($pInfo->products_salemaker == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_SALEMAKER . '</span>' : ''); ?></td>
</tr>
and add directly below
PHP Code:
<tr>
<td class="main"><?php echo TEXT_SOCIALMEDIA_ACTIVE; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_update_social_media', '1', ($in_products_update_social_media==1)) . ' ' . TEXT_YES . ' ' . zen_draw_radio_field('products_update_social_media', '0', ($in_products_update_social_media==0)) . ' ' . TEXT_NO . ' ' . ($pInfo->products_update_social_media == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_SOCIALMEDIA . '</span>' : ''); ?></td>
</tr>
next create a file autofacebook_switch.php
PHP Code:
<?php
/**
autofacebook switch
*/
define('TEXT_PRODUCTS_SOCIALMEDIA', '!! This has Automatically been changed to No');
define('TEXT_SOCIALMEDIA_ACTIVE', 'Facebook Upload');
upload to YOUR ADMIN/includes/languages/english/extra_definitions/
or add the two defines to your YOUR ADMIN/includes/languages/english/product.php
hopefully this is everything. please remember im not an expert on this and will help if i can but do backup first, you only need to backup database and 2 files so not a big job
hope this helps someone and if any of the experienced zenners wish to correct anything this would be much appreciated
i also created the same as the above for the autotwitter module so you have 2 switches if anyone also uses this
thanks
bn
-
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 :)
-
Re: AutoFacebook [Support]
not sure whats not right, on the test site i used the above code it seems to be working fine, test site is v1.51
bn
-
Re: AutoFacebook [Support]
Hi.
I have installed this and when I put a new item on zencart the message appears saying it has posted to facebook but nothing appears. site is www.bikeporn.co.uk and facebook page is http://www.facebook.com/pages/Bikepo...66983630118189. If anyone has any ideas as to why it's not working would really appreciate some input. Guess I am probably doing something silly but cannot work out what.
Thanks in advance
Phil
-
Re: AutoFacebook [Support]
I have an older version of zen cart installed, that's probably why :( I'm gonna update it but not sure when
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
bn17311
hi i got this to work with the zen_get_products_actual_price($products_id) i did have to use the substring to get rid of the zeros
not sure what way this would work with taxes etc but give it a try
PHP Code:
$price = substr(zen_get_products_actual_price($products_id),0,-2);
bn
Thanks bn17311
That worked.
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
infogate
I guess you need the total price with taxes :)
Just use replace with this
Code:
//$price = $products_price;
$price = $_POST['products_price_gross'];
Hi infogate
Thank you.This works and I will go with this solution.
-
Re: AutoFacebook [Support]
hi, this error occured when i uploaded new products but no response at facebook :
Facebook Error: Operation timed out with 0 out of -1 bytes received
can anyone tell me what should i do? thanks.
-
1 Attachment(s)
Re: AutoFacebook [Support]
Attachment 12216
the photo was too small on facebook, can it change to a large photo format? thanks.
-
Re: AutoFacebook [Support]
Jamie,
I have your auto facebook module installed and working on my site. It does update my facebook page when I add new products as well as when I update existing products. The question that I have is this - should others who have liked my page also be able to see those updates/new additions? So far that part isn't working. I am the only person who can see those. Even the other person who I have set up as admin on my page can't see any of the product information.
Pam
-
Re: AutoFacebook [Support]
Hi there,
I am now facing one problem when setting up the AutoFacebook for my zencart 1.5.1 version.
I uploaded all files to my server and the APP ID or Token all are right in the right place.
But when I create a new item, there is red warning as follows at the last step.
Facebook Error: (#200) The target user has not authorized this action
Is there anyone knows the reason and solution? So appreciated if can get any sugggestion from you. Cheers!
Michael
-
Re: AutoFacebook [Support]
Hi
Can anyone tell me why I get the HTML tags on all the auto postings:
<p>
Blue Widget <strong>Red</stong> <p>
-
Re: AutoFacebook [Support]
Totally unrelated to the above post...
I have started getting this error when inserting a new product. Nothing has changed to either coding or my Facebook login details. Any idea why this has started?
Facebook Error: Error validating access token: Session has expired at unix time 1367151630. The current unix time is 1367400487.
-
Re: AutoFacebook [Support]
I was wondering if i may get a little help,
i am using ceon_uri_mapping_4.4.1_for_zc
autoFacebook-v2.3
used win-merge for the update_product.php however when the file is uploaded ceon ceases to work, i can get them to work independently but not together
i would really appreciate the help
-
Re: AutoFacebook [Support]
We have autofacebook on zen cart 1.5.1. It had been working without problem for awhile until a few days ago when we started randomly getting this error
Error Facebook Error: (#1500) The url you supplied is invalid
The error doesn't happen every time but it does more often than not.
Is anyone else experiencing this?
-
Re: AutoFacebook [Support]
Hi,
I currently installed AutoFacebook OG but not AutoFacebook. I still haven't gotten the thumbnails for facebook to work. Will installing AutoFacebook mod solve the thumbnail not being found problem?
Thanks
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
Rizla
I have started getting this error when inserting a new product. Nothing has changed to either coding or my Facebook login details. Any idea why this has started?
Facebook Error: Error validating access token: Session has expired at unix time 1367151630. The current unix time is 1367400487.
Can anyone please throw some light on this problem?
-
Re: AutoFacebook [Support]
Thank you for this usefull addon. Works fine for me. My question is if its possible to modify this addon for vk.com? Thank you
-
Re: AutoFacebook [Support]
Ok
I took drastic action and deleted my app from facebook.
Downloaded the latest for 1.3.9h and also found the video but I'm getting nowhere.
Followed to the letter but when I run the authorization.php this is what I get:
Fatal error: Uncaught OAuthException: Malformed access token CAAHJZAGSuayoBAAZA7KdX5kZC9CFd8M8EScgb6M1PhQs0El7EKGvKZBNVmZAZCZCANlAF6I80d9LhOD wI08lHhfX037VbLNHpdmzzXtkr5vZAyiC64IHIN6VLIRXUwSz2kEIUuctppDJBhiekUUTUmddz3DaEJV bapUZD&expires thrown in /home/EDITED/public_html/facebook/facebook_authorization.php on line 532
The first time I ran it I managed to get to be asked certain permissions but got a similar error at the end. Any ideas?
-
Re: AutoFacebook [Support]
Is this mod supported now?
Any help would save my sanity ;)((
-
Re: AutoFacebook [Support]
Hi
I get this error when I update a product
Facebook Error: (#1500) The url you supplied is invalid
How can I fix this please I have checked that I have the URL right in the file and on the fb app center and they are both right any help is appreciated
Thank you
-
Re: AutoFacebook [Support]
Hi,
HEEEEEEEEEEEEEEELP I've Just Installed zen cart 1.5.1 & I Am Getting Errors when trying to access the facebook_authorization.php...... Please Help.... I love this app & I've had nothing but good things to say about it with the other verssions of zen Cart :wacko:
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
Quality Refurbished
Hi
I get this error when I update a product
Facebook Error: (#1500) The url you supplied is invalid
How can I fix this please I have checked that I have the URL right in the file and on the fb app center and they are both right any help is appreciated
Thank you
I installed on a client cart with no problem but got this message on my own cart right afterwards in the next install. I can't see there's any difference between the 2 except they are on different servers. Could be a port problem. Just a guess.
Rizla - The other error noted many pages back I ran into as well. error 191 while trying to set it up. I skipped a step - didn't put in the domain and url at facebook and got that message. Went away once I did it right.
Obviously the developer prefers not to support his mod - a problem for a long time. I'm glad he updated it but hate the video and have offered to help write the instructions on the Youtube page. Will be interesting to see if I get a response.
I did not watch the video all the way thru so I can tell you that the whole thing isn't necessary to install the mod. The previous written instructions can be helpful in doing this version - missing the facebook changes but can provide some hints.
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
delia
I installed on a client cart with no problem but got this message on my own cart right afterwards in the next install. I can't see there's any difference between the 2 except they are on different servers. Could be a port problem. Just a guess.
It's an error that sometimes comes up the others it's ok I looked around the intnet and its a problem at face books end apparently can't remember when I doing it I think I search the error on google but half the time it does work
-
Re: AutoFacebook [Support]
Hi Delia
I did eventually get it working by using the v1.5 version and not the 1.3.
In desperation I deleted my business page so I've got to start over....
Shame he does not support it!
-
Re: AutoFacebook [Support]
You can see my Facebook page www.facebook.com/laptopsmobiles.co.uk and it has posted on to Facebook page but you never if it will post or not
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
Quality Refurbished
It's an error that sometimes comes up the others it's ok I looked around the intnet and its a problem at face books end apparently can't remember when I doing it I think I search the error on google but half the time it does work
One of the reasons why I hate working with facebook stuff - never know what's causing the problems! I'll have to try again in my cart and see if it will work - oh, and that was an update, not a new product that didn't work. Haven't tried a new product - small cart with few changes.
-
Re: AutoFacebook [Support]
I got it to work with new products and updates in ZC V1.5
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
Quality Refurbished
Hi
I get this error when I update a product
Facebook Error: (#1500) The url you supplied is invalid
How can I fix this please I have checked that I have the URL right in the file and on the fb app center and they are both right any help is appreciated
Thank you
I was getting this error too. Are you running CEON URI Mapping? If so then you have to tick the box to have the URI auto generated. Even if you ticked it when you first uploaded the product. It's a bit of a pain, but it will need ticking every time you make a change on a product. That's what I found worked for me.
Hope that helps.
-
Re: AutoFacebook [Support]
By George, you may be on to something there! I'll check that out.
-
Re: AutoFacebook [Support]
OK. I'm actually updating products as I speak. What I've found is this. When you tick the URI auto generate button for the first time to create the SEO friendly link it throws out the #1500 error. However, when you then go back into the product, the URI is already there, right. But, you then re-tick the button, update the product and voila! It works.
I don't know why that is, but there you go. I'm not a coder or anything, maybe somebody out there can look into this for a future update.
Also, I notice that when you mouse over the link on the product added to your FB page, the auto-generated URI doesn't show up. You get the original SEO UNfriendly link. I don't know whether this problem was addressed earlier on in the thread. I'll have to go back and run a search to see if this particular problem has been solved.
-
Re: AutoFacebook [Support]
What's happening is that autofacebook cannot work with Ceon's mod. No telling what it would take to get it to do that. I'm sure the Ceon developer's knowledge would be needed but he died last November (his absence is going to strongly felt in many ways in the upcoming months and years). JSWeb has supposedly taken over support of those mods but that remains to be seen.
Though it would be nice to have the rewritten url posted on your facebook page, the normal url does work and once they get on the site, all works normally so you are only losing a little (very little) SEO from your link.
So problem would be very hard to fix - therefore, unlikely there will be a fix.
-
Re: AutoFacebook [Support]
Fair enough point. As you say the loss is minimal plus Facebook are constantly changing the way their API works. There's a lot of third party apps that will work fine one day, then FB do a dance and everybody has to suddenly change from a waltz to a polka!
The current plug in works fine and I can live with it.
-
Re: AutoFacebook [Support]
After ftp the facebook_authorization.php to my site, I clicked to http://myshop.com/facebook_authorization.php
The page asked some questions about let facebook XXX manage this page (something like this!), and I clicked "ok" for all questions. Then it showed up the following error:
Code:
Status: array (
0 => 'access_token',
1 => 'CAAFIAGUjZA2kBALPR78YvPOvf0T7gtQ10dcl0ZAdUuyVoE4scOOynhHtie10rW37FWnTReuMsJZAZAbr7yHZBG9ViZAXhsxpXR1OK1TvB7tOOIu3bK78Xb9ANqWzY3eNLbgvVKAdwZA7JSNZBz7tIZAuVbXZCU9CiiAGAZD&expires',
2 => '5183043',
)
Array
(
[data] => Array
(
)
)
array (
'data' =>
array (
),
)
after a while, I refreshed the page, it showed anothe page with:
Code:
Status: array (
0 => '{"error":{"message":"This authorization code has expired.","type":"OAuthException","code":100}}',
)
Below showed the error log:
Code:
23:05:45] PHP Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user.
thrown in /public_html/facebook_authorization.php on line 533
I installed autoFacebook-v2.3, with 1.5.1 zencart and PHP Version: 5.2.17 (Zend: 2.2.0)
How can I fix it. Thanks very much!
-
Re: AutoFacebook [Support]
Problems solved!
I missed to open a fan page before visiting http://xxx/facebook_authorization.php
It is a Great module! Save much time to manage facebook fan page!
If facebook fan can show discount price is perfect! Now it is the original price.
-
Re: AutoFacebook [Support]
Hi Delia,
Real pity this mod isn't supported - maybe one day another coder familiar with Zen-Cart will pick up the ball and run with it :smile:
Do you have any idea how to limit the auto upload to Facebook so that it only applies to certain conditions, e.g. new item or item placed on sale - currently it uploads EVERY TIME there is a minor adjustment to the product description - this can mean 3 or more times for the same product if you decide to modify what you have submitted which I do quite often - it is a real pain when you are making description changes or additions to hundreds of existing items in a batch - slows things down considerably also whilst trying to reach Facebook and I'm sure my Facebook followers do not want to receive hundreds of alerts in a short period of time (they would soon become ex followers).
Any advice is welcomed.
cheers,
Mike
I 'chased' Jamie Life via his website/blog for ages before I got any responses from him many moons ago
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
shags38
Do you have any idea how to limit the auto upload to Facebook so that it only applies to certain conditions, e.g. new item or item placed on sale - currently it uploads EVERY TIME there is a minor adjustment to the product description - this can mean 3 or more times for the same product if you decide to modify what you have submitted which I do quite often - it is a real pain when you are making description changes or additions to hundreds of existing items in a batch - slows things down considerably also whilst trying to reach Facebook and I'm sure my Facebook followers do not want to receive hundreds of alerts in a short period of time (they would soon become ex followers).
I did make this modification on my site so on the product page in the admin there is a radio button to update fb or not because I was running into this very problem. There are several core files to edit and a db modification or two but it allows you to dictate when fb is updated. I was using one of the earlier versions of this mod (not the lite version), I haven't been following this so I don't know where it is code-wise compared to what I am using. But I think my changes might be neutral in relation to this module's code but I need to double check since it's been quite a while since I wrote it. I will have a look at my code and notes and post it here for anyone that is interested.
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
lankeeyankee
I did make this modification on my site so on the product page in the admin there is a radio button to update fb or not because I was running into this very problem. There are several core files to edit and a db modification or two but it allows you to dictate when fb is updated. I was using one of the earlier versions of this mod (not the lite version), I haven't been following this so I don't know where it is code-wise compared to what I am using. But I think my changes might be neutral in relation to this module's code but I need to double check since it's been quite a while since I wrote it. I will have a look at my code and notes and post it here for anyone that is interested.
Many thanks Lanky!! I look forward to you posting the code.
cheers,
Mike
-
Re: AutoFacebook [Support]
OK, here are the changes I made. I recommend testing them on a test site since I was using the earlier version of auto facebook (version 2.0) and there might be some compatibility issues with a newer version of the module. You will need to add an extra field to the db products table so you should back up your db before doing this. Also, this is on 1.3.9h so there may or may not be differences in where to place the new code in 1.5.x but it should still work.
Insert this using phpmyadmin or in the sql patch in the admin. The db field, you might need to change the table name if you add prefixes so table products might become table zen_products or whatever:
Code:
ALTER TABLE `products` ADD `facebook_add` tinyint(1) NOT NULL DEFAULT '0';
In admin/includes/modules/product/collect_info.php around line 41 look for this line
PHP Code:
'master_categories_id' => ''
and change it to
PHP Code:
'master_categories_id' => '',
'facebook_add' => ''
around line 59 look for
PHP Code:
p.master_categories_id
and change to
PHP Code:
p.master_categories_id, p.facebook_add
around line 150 look for this
PHP Code:
// Products can be purchased with mixed attributes retail
if (!isset($pInfo->products_quantity_mixed)) $pInfo->products_quantity_mixed = '0';
switch ($pInfo->products_quantity_mixed) {
case '0': $in_products_quantity_mixed = false; $out_products_quantity_mixed = true; break;
case '1': $in_products_quantity_mixed = true; $out_products_quantity_mixed = false; break;
default: $in_products_quantity_mixed = true; $out_products_quantity_mixed = false;
}
and after it add this
PHP Code:
if (!isset($pInfo->facebook_add)) $pInfo->facebook_add = '0';
switch ($pInfo->facebook_add) {
case '0': $is_facebook_add_enabled = false; $not_facebook_add_enabled = true; break;
case '1': $is_facebook_add_enabled = true; $not_facebook_add_enabled = false; break;
default: $is_facebook_add_enabled = false; $not_facebook_add_enabled = true;
}
around line 412 look for this
PHP Code:
<tr>
<td class="main"><?php echo TEXT_PRODUCT_IS_FREE; ?></td>
and right above it add this
PHP Code:
<tr>
<td class="main">Add/update Facebook?</td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('facebook_add', '1', $is_facebook_add_enabled) . ' Yes ' . zen_draw_radio_field('facebook_add', '0', $not_facebook_add_enabled) . ' No ' . ($pInfo->facebook_add == 1 ? 'Add to facebook?' : ''); ?></td>
</tr>
You can add the above line of code anywhere in that table that suits your preference, I just found it convenient to add it there.
In admin/includes/modules/product/preview_info.php look around line 26 for
PHP Code:
p.products_sort_order
and change to
PHP Code:
p.products_sort_order, p.facebook_add
around line 74 look for
PHP Code:
echo zen_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description;
}
?>
</td>
</tr>
and change it to
PHP Code:
echo zen_image(DIR_WS_CATALOG_IMAGES . $products_image_name, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description;
}
?>
<!--BO FACEBOOK-->
</tr><tr>
<td><hr></td>
</tr><tr>
<td class="smallText">
<?php
$facebook_add = $_POST['facebook_add'];
if ($facebook_add == 1) {
echo "Facebook Will be Updated.";
} else {
echo "Facebook Will NOT be Updated.";
}
?>
</td> </tr>
<tr>
<!--EO FACEBOOK-->
</td>
</tr>
This gives you a message on the preview page of whether or not facebook will be updated.
In admin/includes/modules/update_product.php around line 9 look for
PHP Code:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
and after add this
PHP Code:
$facebook_add = $_POST['facebook_add'];
around line 52 look for
PHP Code:
'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter'])
and change it to
PHP Code:
'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter']),
'facebook_add' => zen_db_prepare_input($_POST['facebook_add'])
around line 87 look for
PHP Code:
//// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////
and below it add
PHP Code:
if ($facebook_add == 1) {
Now, this is where one of the main auto facebook code is in my site, I do not know if this is still the case with other/newer versions of this module. If the auto facebook code block is still there then at the end of it you will need to add
around line 104 look for
PHP Code:
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
and insert below
PHP Code:
if ($facebook_add == 1) {
And again there is the second block of facebook code to which you will need to add this to the end of the facebook code block
I just tested this and it is still adding a product to fb when I choose the option to add it. BUT, and this may have been sorted or not with other versions, the html in the description like <p> is included in the fb listing and is not stripped/converted by fb like it used to be. I looked into it and it's an easy fix. In update_products if there is this line (it's there twice in mine)
PHP Code:
$prod_description = $_POST['products_description'][$_SESSION['languages_id']];
change to
PHP Code:
$prod_description = strip_tags($_POST['products_description'][$_SESSION['languages_id']]);
and now all html tags are stripped from the product description.
Also, my changes in update_product should be able to be applied to newer/different versions of the module as long as the last 2 edits ( adding if ($facebook_add == 1) { and then the closing } at the end of the block) are added wherever the new fb code blocks are. I say should, because I can't say for sure if it will work since I haven't tried it.
I am using the version 2.0 and it's working perfectly especially now I got the html tags stripped from the product descriptions, so I have never bothered to change what ain't broke. Like I said, this may or may not work with newer versions. I can try to help if there are major changes in the code in the new version.
-
Re: AutoFacebook [Support]
I looked at the new version and my code should work with it and I see they have addressed the strip tags in this version.
Please also note, once you have added the product to fb, if you go back in to edit/update your product you might want to switch the "add to facebook" to no so it won't add the same product again once you update it. Otherwise it will be added to fb again.
-
Re: AutoFacebook [Support]
Hi Lankee,
Firstly I am not a coder :smile: I am using autofacebook v2.1 on ZC v1.3.9h
I have modified files as per your instructions and now get this in the admin/products pages and nothing else, the whole 'form' is not showing;
1054 Unknown column 'p.facebook_add' in 'field list'
in:
[select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_virtual, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max, p.products_sort_order, p.products_discount_type, p.products_discount_type_from, p.products_price_sorter, p.master_categories_id, p.facebook_add from products p, products_description pd where p.products_id = '62' and p.products_id = pd.products_id and pd.language_id = '1']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
I have double checked everything and am confident I have put all the code in the right places, with the exception of;
In admin/includes/modules/update_product.php around line 104 look for
PHP Code:
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
and insert below
PHP Code:
if ($facebook_add == 1) {
And again there is the second block of facebook code to which you will need to add this to the end of the facebook code block
PHP Code:
}
in my file it shows;
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
i.e., nothing in between the instructions titles so I added code- if ($facebook_add == 1) {
and because there does not appear to be any other block of code that does not already have the } at the end of it, I inserted it as follows;
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
if ($facebook_add == 1) {
}
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
I have obviously done something wrong - any ideas where I may have slipped up? Do you need me to post the whole of all the files as modified?
cheers,
Mike
p.s. the facebook_add was successfully added to the db table via myphpAdmin
-
Re: AutoFacebook [Support]
what version of zc are you using? Also, can you confirm in phpmyadmin that facebook_add is definitely in the products table?
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
lankeeyankee
what version of zc are you using? Also, can you confirm in phpmyadmin that facebook_add is definitely in the products table?
same as you - v1.3.9h - yes it is definitely in the products table in db
-
Re: AutoFacebook [Support]
copy of db 'structure' for 'products' showing facebook_add at bottom of list
Browse
Structure
SQL
Search
Insert
Export
Import
Operations
Triggers
# Name Type Collation Attributes Null Default Extra Action
1 products_id int(11) No None AUTO_INCREMENT Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
2 products_type int(11) No 1 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
3 products_quantity float No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
4 products_model varchar(32) latin1_general_ci Yes NULL Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
5 products_image varchar(64) latin1_general_ci Yes NULL Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
6 products_price decimal(15,4) No 0.0000 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
7 products_virtual tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
8 products_date_added datetime No 0001-01-01 00:00:00 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
9 products_last_modified datetime Yes NULL Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
10 products_date_available datetime Yes NULL Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
11 products_weight float No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
12 products_status tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
13 products_tax_class_id int(11) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
14 manufacturers_id int(11) Yes NULL Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
15 products_ordered float No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
16 products_quantity_order_min float No 1 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
17 products_quantity_order_units float No 1 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
18 products_priced_by_attribute tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
19 product_is_free tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
20 product_is_call tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
21 products_quantity_mixed tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
22 product_is_always_free_shipping tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
23 products_qty_box_status tinyint(1) No 1 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
24 products_quantity_order_max float No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
25 products_sort_order int(11) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
26 products_discount_type tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
27 products_discount_type_from tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
28 products_price_sorter decimal(15,4) No 0.0000 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
29 master_categories_id int(11) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
30 products_mixed_discount_quantity tinyint(1) No 1 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
31 metatags_title_status tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
32 metatags_products_name_status tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
33 metatags_model_status tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
34 metatags_price_status tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
35 metatags_title_tagline_status tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
36 facebook_add tinyint(1) No 0 Change Change Drop Drop Browse distinct values Browse distinct values Primary Primary Unique Unique Show more actions More
With selected: Check All / Uncheck All With selected:
-
Re: AutoFacebook [Support]
hmm, I am not sure why it's doing that. I have looked and searched through my entire site files and these are the only files and the only lines affected. The only thing I can recommend at this point is to double check all of the code edits to make sure everything is there and nothing accidentally added or overwritten. If you are still having a problem, you can set up a temp ftp account for me and I can check your files or you can zip them all and send them to me to double check.
-
Re: AutoFacebook [Support]
specifically, look in collect_info as that is where the problem is.
-
Re: AutoFacebook [Support]
oooops! False alarm - I added facebook_add to the wrong db - long story as to why I have more than one db :huh:.
Products page is OK now - except for the following;
1. in admin/product and adding a new product after clicking 'preview' this piece of code appears on the top of the confirmation page } ?>
2. there is a comment at the very bottom of the page 'Facebook Will NOT be Updated.'
3. there is no radio button to select to add to facebook or not
cheers,
Mike
-
Re: AutoFacebook [Support]
glad to hear that that problem is sorted. It sounds like some of the other code snippets are off or missing something. The }?> means that there is no <?php before it, probably in that blank space where you added the empty line. You should copy the entire facebook code block from the "insert" section and insert it into that "updates" section including the bits that I added.
That comment is supposed to appear, it lets you know before clicking the update button whether or not fb will be updated. In this case, it won't be.
It looks like you missed adding this section of code:
PHP Code:
<tr>
<td class="main">Add/update Facebook?</td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('facebook_add', '1', $is_facebook_add_enabled) . ' Yes ' . zen_draw_radio_field('facebook_add', '0', $not_facebook_add_enabled) . ' No ' . ($pInfo->facebook_add == 1 ? 'Add to facebook?' : ''); ?></td>
</tr>
in collect_info. You should be adding it around line 308, right above
PHP Code:
<tr>
<td class="main"><?php echo TEXT_PRODUCT_IS_FREE; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('product_is_free', '1', ($in_product_is_free==1)) . ' ' . TEXT_YES . ' ' . zen_draw_radio_field('product_is_free', '0', ($in_product_is_free==0)) . ' ' . TEXT_NO . ' ' . ($pInfo->product_is_free == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_IS_FREE_EDIT . '</span>' : ''); ?></td>
</tr>
Please check to make sure it's there. It will be a radio button right below where you add the product title, where the other radio button are above the tax and price.
This will work much better if you copy that block of fb code like I suggest, this way it will allow to add to fb if you are creating a new listing or updating an old one. Currently, you are only going to be able to do it when creating a new one since the block is missing from the "update" section.
Also note, I was lazy and hardcoded the text stuff for the radio button in the code instead of making it a define. If someone wants to be proper, they should substitute YES_TEXT and NO_TEXT for Yes and No in the above snippet as well as adding a define for the "Add to Facebook?" text.
-
Re: AutoFacebook [Support]
Hi Lankee,
adding to previous post - new products will not add to the site after clicking insert - it just takes me to a totally blank page.
seems I am close but not close enough :)
cheers,
Mike
-
Re: AutoFacebook [Support]
That should be TEXT_YES and TEXT_NO, too late to edit my post.
-
Re: AutoFacebook [Support]
The fastest way is to just zip those 3 files and post them, I will have a quick look and fix them. Then I can discuss what went wrong to give you insight when working on other stuff and to maybe help someone else out that experiences these problems. Likely something very simple like a closing } or ; missing, probably in the preview_info file.
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
lankeeyankee
The fastest way is to just zip those 3 files and post them, I will have a quick look and fix them. Then I can discuss what went wrong to give you insight when working on other stuff and to maybe help someone else out that experiences these problems. Likely something very simple like a closing } or ; missing, probably in the preview_info file.
pleading ignorant here - how do I zip and post the zipped folder or files in here? (the files are copied and pasted in a previous past above) - ??
-
Re: AutoFacebook [Support]
if you don't have a zip program, use something like 7zip or other free zip tools to compress the files into a zip and in the advanced reply you will see where you can upload files. Or you can try to upload them without zipping but I don't know if you can upload php files since it might be a security thing. It would clutter the thread to post the entire contents of all 3 files in a post and will make it easier to open them in my text editor to make the corrections. But if posting the files in the thread is the only option do it in 3 separate posts, one for each file.
-
Re: AutoFacebook [Support]
Hi Lankee,
Firstly ... MANY, MANY THANKS for your assistance !!!
Bravo - it works and works extremely well !! - just the answer I was looking for and I am sure other users are looking for. This is now an excellent and useful tool.
In my humble opinion I think either yourself or DivaVocals (or some moderator) should adopt your changes into the plugin as it now stands given that it is not being supported so that everyone can enjoy this plugin. A few lines of code change and a few notes in the readme and I believe then that this plugin will be very, very useful for many Zenners. I will now adapt it to all 10 of my sites as I develop Facebook pages for them.
Again mate, well done!!
cheers,
Mike
p.s. my error was in the second set of this group - (I have no idea why it is repeated_ - I left it blank but somehow I must have deleted the } directly after it - after finding that error by comparing modified file to original file it now works. I am still getting that bit of code on the confirmation / insert page so when I can figure out how to get a copy of my modified .php files to you maybe then you might spot what I missed (advanced won't accept.7zip files ??)
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
}
-
Re: AutoFacebook [Support]
I'm glad to hear that you got it working correctly now. I don't know why it's still showing a bit of misplaced code but something went a little wrong.
You should be pasting all of the facebook code from the insert section, including the little snippets I posted, inside of this "updates" section like this
Code:
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
insert the facebook code from "insert" section here including my code
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
Now, if you want, you can also (or instead of for existing products before this mod was added) add to facebook when updating the product as well as when adding it. This might correct the problem of the misplaced code showing up in the preview page. I agree that the code should be added, I offered to do it before a couple years back in this thread but not a single person replied about it so I didn't want to waste my time on something that might not be used or wanted by the masses which is the case for most of my work.
If you can't find out how to get rid of the extra bit that's showing up on the preview page, post the code. When you are zipping the files in 7zip you need to change the extension to .zip (save as a .zip and not .7zip) and then you can upload it here. I will have a look and correct the problem and let you know what needs to be done. Obviously, I didn't do a very good job of explaining all of the steps for which I apologize. I know it's frustrating to spend time figuring out niggling little things when there are better things to do so I need to see what went wrong to help others avoid it.
-
Re: AutoFacebook [Support]
edit timed out again...
There are 2 separate sections, one that says
Code:
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC INSERTS* ////////
///////////////////////////////////////////////////////
and one that says
Code:
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
The first is for when you are first creating, or inserting, a product and the second is for when you are changing or updating a product. Both should really have identical copies of the facebook code plus my little snippets. This may or may not correct your problem if there is a bit of errant code in there somewhere. But, you should put the code in both to make this the most flexible.
Just remember, tell your customers that if they have already added a product to fb and they go back to change something they should change the add to facebook radio button to "no" so the product won't get added a second time unless they want it to.
-
Re: AutoFacebook [Support]
thanks for the rename .zip hint - Attachment 12773Attachment 12774Attachment 12775 hopefully the files have uploaded correctly.
I will make a recommendation to those in the know about getting this modification adapted - I think SWGUY is a moderator - this is a fantastic marketing tool now and I don't know why every Zenner wouldn't use it if they also have a Facebook page or store at least now with this great function. The readme needs work for people without a lot of IT knowledge to be able to install it more easily, it confused many including me (I think a lot of people gave up due to this aspect and lack of support)
cheers,
Mike
you will note there are two of these in the file update_product.php - I figure one is an errant duplication??
///////////////////////////////////////////////////////
//// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE //////
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* ////////
///////////////////////////////////////////////////////
-
Re: AutoFacebook [Support]
isn't it amazing how the brain will read what it wants to and not what it sees :smile:
I will put the code in the other one now and see if that gets the code to disappear from the page.- it begs the question though if the code was only originally in the 'insert' section as to why it was uploading all 'updates' as well? Anyway - fixed now, right.
I am my own customer and I have no doubt that I will forget to change the radio button for a while until I get used to it - old habits die hard.
cheers,
Mike
-
Re: AutoFacebook [Support]
Line 97 to 100 of preview_info. Just delete those lines
PHP Code:
}
?>
</td>
</tr>
None of that should be there.
You also had an error with the closing } of my snippet in the facebook code blocks in update_products. You put them in too soon, they should have been at the bottom of the entire facebook code block which ends right above
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* //////// ///////////////////////////////////////////////////////
and
//// *END OF PRODUCT-TYPE-SPECIFIC INSERTS* //////// ///////////////////////////////////////////////////////
I have edited the files in the attachment, just upload them and you should be good. Please let me know if you have any other issues.
Edit: I will be the first to admit I don't know everything about zen cart code, I thought the "insert" section was for when products are being added and the "updates" was for when they are being modified. I could very easily be wrong and it would be far from the first time (or the last).:laugh:
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
lankeeyankee
Line 97 to 100 of preview_info. Just delete those lines
PHP Code:
}
?>
</td>
</tr>
None of that should be there.
You also had an error with the closing } of my snippet in the facebook code blocks in update_products. You put them in too soon, they should have been at the bottom of the entire facebook code block which ends right above
//// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* //////// ///////////////////////////////////////////////////////
and
//// *END OF PRODUCT-TYPE-SPECIFIC INSERTS* //////// ///////////////////////////////////////////////////////
I have edited the files in the attachment, just upload them and you should be good. Please let me know if you have any other issues.
Edit: I will be the first to admit I don't know everything about zen cart code, I thought the "insert" section was for when products are being added and the "updates" was for when they are being modified. I could very easily be wrong and it would be far from the first time (or the last).:laugh:
Thanks Lankee,
deleting that code got rid of the errant code on the preview page - thanks.
Using your corrected update_product.php file caused the same error it did for me when I entered code in the update section - it causes a blank page after hitting update, goes nowhere and using back button then requires a browser 'resend'. Even deleting that } after the updates section does the same so there is something else awry here.
So I deleted all code from the updates section and re-inserted the } below it so now it updates Facebook ok for 'new products' (but understandably not for updates of product.) ??
cheers,
Mike
-
Re: AutoFacebook [Support]
I just looked again and noticed you must have deleted a } at the end of the "updates" section. I have corrected it and posted the new code here.
-
Re: AutoFacebook [Support]
Quote:
Originally Posted by
lankeeyankee
I just looked again and noticed you must have deleted a } at the end of the "updates" section. I have corrected it and posted the new code here.
Hi Lankee,
Alas when I use your new modified update_product file nothing updates .. ?? So I have reverted to the file I originally sent you. It updates Facebook with new product via 'inserts' but not updates.
I will continue to play with the code over the next couple of days to see if I can get it to work on 'updates' as I agree that this would be a great advantage (being able to rotate products onto FB when required).
cheers,
Mike