Forums / All Other Contributions/Addons / AutoFacebook [Support]

AutoFacebook [Support]

Views: 141,424

Results 581 to 600 of 691
21 Jul 2013, 1:58 AM
#581
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

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

21 Jul 2013, 2:11 AM
#582
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

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:

<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

<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.


Zen Cart and it's community are the best!!

21 Jul 2013, 2:12 AM
#583
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

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

21 Jul 2013, 2:19 AM
#584
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: AutoFacebook [Support]

That should be TEXT_YES and TEXT_NO, too late to edit my post.


Zen Cart and it's community are the best!!

21 Jul 2013, 2:21 AM
#585
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

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.


Zen Cart and it's community are the best!!

21 Jul 2013, 2:44 AM
#586
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: AutoFacebook [Support]

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) - ??

21 Jul 2013, 2:55 AM
#587
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

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.


Zen Cart and it's community are the best!!

21 Jul 2013, 4:03 AM
#588
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

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* ////////
  ///////////////////////////////////////////////////////
}
21 Jul 2013, 4:28 AM
#589
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

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

///////////////////////////////////////////////////////
      //// 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.


Zen Cart and it's community are the best!!

21 Jul 2013, 4:41 AM
#590
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: AutoFacebook [Support]

edit timed out again...

There are 2 separate sections, one that says

///////////////////////////////////////////////////////
      //// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE //////


      ////    *END OF PRODUCT-TYPE-SPECIFIC INSERTS* ////////
      ///////////////////////////////////////////////////////

and one that says

///////////////////////////////////////////////////////
      //// 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.


Zen Cart and it's community are the best!!

21 Jul 2013, 4:46 AM
#591
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: AutoFacebook [Support]

thanks for the rename .zip hint - [Attachment no longer available][Attachment no longer available][Attachment no longer available] 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* ////////
  ///////////////////////////////////////////////////////
21 Jul 2013, 4:54 AM
#592
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

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

21 Jul 2013, 5:08 AM
#593
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: AutoFacebook [Support]

Line 97 to 100 of preview_info. Just delete those lines

}
          ?>
        </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:


Zen Cart and it's community are the best!!

21 Jul 2013, 5:24 AM
#594
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: AutoFacebook [Support]

lankeeyankee:

Line 97 to 100 of preview_info. Just delete those lines

}
?>
</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
21 Jul 2013, 5:44 AM
#595
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

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.


Zen Cart and it's community are the best!!

21 Jul 2013, 8:22 AM
#596
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: AutoFacebook [Support]

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

21 Jul 2013, 9:00 AM
#597
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: AutoFacebook [Support]

I looked at the code again in update_products and noticed that you put the first line of my code in the wrong spot, it was inside the

if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
  }

so this was never being run

$facebook_add = $_POST['facebook_add'];

Try the new file and see if it finally works.


Zen Cart and it's community are the best!!

21 Jul 2013, 9:23 AM
#598
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: AutoFacebook [Support]

lankeeyankee:

I looked at the code again in update_products and noticed that you put the first line of my code in the wrong spot, it was inside the

if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}

> 
> so this was never being run
> ```php
$facebook_add = $_POST['facebook_add'];

Try the new file and see if it finally works.

We have lift-off Houston = Success = works a treat !!!

Thanks again - now we will see if we can make this available for everyone :)

So what other contributions have you put forward Lankee? - you mentioned something earlier.

cheers,
Mike

22 Jul 2013, 10:31 AM
#599
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,725
Plugin Contributions:
56

Re: AutoFacebook [Support]

If you bundle up your work and submit it as a new version to

http://www.zen-cart.com/downloads.php?do=file&id=1095

then everyone will have access to it.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

22 Jul 2013, 3:21 PM
#600
jaychan2013 avatar

jaychan2013

New Zenner

Join Date:
Jun 2013
Location:
Hong Kong
Posts:
27
Plugin Contributions:
0

Re: AutoFacebook [Support]

Does anyone know how to show up the product price together with special price in facebook page?

Thank you very much!