I moved my autoFacebook low on the update_product.php page so my items will update even when I edit an item because I like to duplicate and edit for new items, but sometime I just change quantities because of ebay sales and don't want them to update at facebook as a new item, sometimes I have zero quantity and don't want to disable the item.
I changed some files, just so you know, I know just enough PHP to get me in trouble sometimes.
I may add to the lanquage files later, but for me this works
Here is what I edited-
admim/includes/modules/product/
collect-Info.php
preview_info.php
collect-Info.php- I added in bold and where
Code:
<tr>
<td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main">Facbook Update </td>
<td class="main"> <input type="checkbox" name="facebook_update" value="Yes" />Check for yes</td>
</tr> <tr>
<td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_weight', $pInfo->products_weight); ?></td>
</tr>
preview_info.php
Code:
//auto replace with defined missing image
if ($_POST['products_image_manual'] != '') {
$products_image_name = $_POST['img_dir'] . $_POST['products_image_manual'];
$pInfo->products_name = $products_image_name;
}
if ($_POST['image_delete'] == 1 || $products_image_name == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') {
echo zen_image(DIR_WS_CATALOG_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="right" hspace="5" vspace="5"') . $pInfo->products_description;
} else {
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
if ($facebook_update == "Yes") {
echo "Facebook Will be Updated.";
} else {
echo "Facebook Will NOT be Updated.";
}
?>
</td> </tr>
<tr>
<!--EO FACEBOOK-->
</td>
</tr>
<?php
if ($pInfo->products_url) {
?>
<tr>
<td><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo sprintf(TEXT_PRODUCT_MORE_INFORMATION, $pInfo->products_url); ?></td>
</tr>
<?php
admim/includes/modules/
update_product.php around the autofacebook code
Code:
if ($facebook_update == "Yes") {
//AutoFacebook light
$pageID = "edited"; //received when signing up.
// no need to edit below this line
$prod_vars = array(
'page' => $pageID,
'prod_image' => $_POST['products_image'],
'price' => $products_price,
'prod_name' => $_POST['products_name'][$_SESSION['languages_id']],
'prod_description' => $_POST['products_description'][$_SESSION['languages_id']],
'prod_url' => '/index.php?main_page=product_info&cPath=' . $current_category_id . '&products_id=' . $products_id, );
$url = "http://apps.htmyell.com/fbpageid/sendvars.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $prod_vars);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
if (isset($result['success'])){ $messageStack->add_session('Facebook was successfully updated!', 'success');}
else if (isset($result['error'])){ $messageStack->add_session('Facebook Error: '.$result['error'], 'error'); }
else { $messageStack->add_session('Error: '. $result, 'error'); }
//end of autoFacebook
}
else
{
}
Actually in the if else, I don't know if something has to be placed in there when the box isn't checked.
No database updates needed, but make copies of the three files edited incase you have to go back and use them
Dan
Bookmarks