Zen Cart Logo
Forums / All Other Contributions/Addons / Facebook - eCommerce Catalog Browse [Support]

Facebook - eCommerce Catalog Browse [Support]

Views: 34,652

Results 41 to 60 of 250
29 Apr 2011, 8:41 PM
#41
djace avatar

djace

New Zenner

Join Date:
Sep 2010
Posts:
45
Plugin Contributions:
0

Facebook - eCommerce Catalog Browse [Support]

Hello Brightsoftware,

I was suspecting something like that to be the case since other people got it up and running.
Thank you for taking time and explaning it to me.
I will setup the facebook page and finish installing your mod tonight.
Thanks again.

Djace

19 May 2011, 8:42 AM
#42
werybigmonk avatar

werybigmonk

New Zenner

Join Date:
May 2011
Posts:
1
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Is it possible to add localization to facebook app?
Right now products and descriptions is loaded with correct localization, but fb app titles seems to be exclusively in english.
F.ex. titles could be fetched from the webshop.

Additionally it would be nice to have an option to filter categories shown on page. (This can be done by modifying feed script, but menu-based solution would be nice)

19 May 2011, 2:04 PM
#43
brightsoftware avatar

brightsoftware

New Zenner

Join Date:
Apr 2011
Posts:
93
Plugin Contributions:
1

Re: Facebook - eCommerce Catalog Browse [Support]

Hi,

Localization and best-sellers view are both currently in development. Our planned development schedule is to release two other plug-ins for other shop systems, and then later release an updated app with these features.

Hopefully these features will be available around the middle of next month.

We will also look into the possibility of a category management functionality, for a future release.

Thanks for your feedback and suggestions! Keep them coming!

22 May 2011, 9:13 AM
#44
rizla avatar

rizla

Zen Follower

Join Date:
Sep 2010
Posts:
449
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Well I got it working on our Facebook page with no problems. Unfortunatley as I am a Facebook noob! I can't see it helping that much if it was a paid App.

This being due to the fact that I only got involved (sorry.. had to tread a toe) in Facebook because my template had the links.

I don't see many people using the site favebook link at present. And then why would they want to see another version of the goods?

ok, I know I have a lot of facebook reading to do but I wondered if the was a way to make it more 'viral' as the "autoFacebook2" does,,,, ie. all friends and friends of friends get to see my new products! (I think)

Meybe I just don't get the Facebook thing yet? But the App works with no installation problems.

Thanks

23 May 2011, 7:18 AM
#45
brightsoftware avatar

brightsoftware

New Zenner

Join Date:
Apr 2011
Posts:
93
Plugin Contributions:
1

Re: Facebook - eCommerce Catalog Browse [Support]

Hi Rizla,

This add-on provides a different methodology to AutoFacebook, which is designed to draw existing Friends/Likers back to your website by keeping them up-to-date on your new products etc. The idea is that hopefully you will get them to re-order, but they will already know you exist.

The idea of Catalog Browser is to try and draw new customers to your website. They will search on Facebook and see your page and then immediately see your product catalog.

Also when your existing customers "like" your Facebook page, or any of the products through the Catalog Browser, their friends will see they like your page or product and in-turn may visit your Facebook page. The means that you can encourage more new people to visit your website.

We are anticipating that we will be able to offer a free version for people who don't have many 'likes' (i.e. fans) so only as your Facebook page grows, and hopefully provides you with a benefit, will you need to pay anything.

Hope this helps

23 May 2011, 12:45 PM
#46
ozprodrivers avatar

ozprodrivers

New Zenner

Join Date:
Feb 2008
Location:
Brisbane Australia
Posts:
75
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

stevesh:

My mistake, maybe. Your website talks about a Free Trial for this program, which makes it commercial software after the trial period. If you're going to offer a free Zencart version, I'll look forward to trying it.

Hello Mr brightsoftware
Thank You for your contribution. I would like to clarify the statement on your website,
Please Note: This is a free no-obligation trial. You will not be asked for any payment details. Beta-users will be given at least 1 month's free usage at the end of the trial period, after which you may choose whether or not you wish to continue using the App based on one of the price plans.
What are the price plans and is your marketing plan intended to get users onto the bus then release the cost structure
The details in the software release does not elude to this
Facebook - eCommerce Shop Browser
Whereas this module has the notation
*** NOTE: A MONTHLY FEE IS REQUIRED TO USE THIS MODULE ***
ozpost
I have just recommended it to a customer and installed your module and now read this forum post
Thanks for your clarification
daveh

23 May 2011, 2:19 PM
#47
brightsoftware avatar

brightsoftware

New Zenner

Join Date:
Apr 2011
Posts:
93
Plugin Contributions:
1

Re: Facebook - eCommerce Catalog Browse [Support]

Hi Daveh

The initial plan is to launch as a trial so we can evaluate the hosting/bandwidth and support costs involved in hosting a Facebook app whilst ironing out and bugs and issues found by our trial users. This contribution has always been listed as a free beta trial.

We are anticipating that we will be able to offer a free or advert supported 'lite' version, and then monthly subscription full versions. But at present we are still trying to create more add-ons for different shop platforms and accepting suggestions of improvements to the app itself to provide a better product.

As stated earlier in this thread, we were expecting it to be around $20 but this has now been halved to $10 per month after our initial market and technical requirements analysis.

Hope this helps.

Bright Software Solutions

24 May 2011, 11:49 PM
#48
ozprodrivers avatar

ozprodrivers

New Zenner

Join Date:
Feb 2008
Location:
Brisbane Australia
Posts:
75
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Hello Sir,
Thank You now I am understanding where you are at. From my perspective I downloaded the module installed it into a customers site then as i was setting up the FB page I saw a subscription. I was committed to setting it up so went forward with it
Maybe just add a line in your module details in this site etc
We have set it up and we are impressed Thank You for your services
Regards
daveh

26 May 2011, 3:01 PM
#49
cooler0918 avatar

cooler0918

New Zenner

Join Date:
Apr 2011
Posts:
26
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Are there any plans to make the online catalog viewable via SSL. Most of my facebook contacts use the new SSL browser feature and when they access the catalog, it requires them to switch to non-SSL

Thanks
www.ahaccessories.com

26 May 2011, 4:52 PM
#50
brightsoftware avatar

brightsoftware

New Zenner

Join Date:
Apr 2011
Posts:
93
Plugin Contributions:
1

Re: Facebook - eCommerce Catalog Browse [Support]

Hi Cooler0918,

Thanks for pointing that out, SSL on the Facebook App should now be working.

Cheers

Bright Software

27 May 2011, 4:01 AM
#51
cooler0918 avatar

cooler0918

New Zenner

Join Date:
Apr 2011
Posts:
26
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Thank you very much for the quick response and fix :clap:

I had one more question I was looking through the documentation in order to get a better understanding of the features and I can't fins anything on the field Display ##########_ button and check box. Also is there some instructions on how to setup the banner in the docs it says load up(which I didn't understand) or point to an internet location (this one I get).

The Display in-stock options says it's only available for 1.7 and above. Do I need to upgrade something on my cart side? and I apologize ahead of time if I might have just miss a post about this.

Thank you
http://www.ahaccessories.com

27 May 2011, 4:39 AM
#52
cooler0918 avatar

cooler0918

New Zenner

Join Date:
Apr 2011
Posts:
26
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Hmm I just tried the facebook share bottom and I am seeing some strange behavior. The post made from me is on my profile but not showing on the news feed under most recent. If I change it to top news I see the post made by my page but still not mine. On the page it shows on the wall and on most recent feed but not on top news while using fb as the page. I just checked again and now I see the my post on most recent but now the page while using FB as me not the page.

Also I checked an other persons account and they also like the page and I don't see it either from me or the page in either most recent or top news. Very weird any thoughts:unsure:

Thank you
http://www.ahaccessories.com

27 May 2011, 7:38 AM
#53
brightsoftware avatar

brightsoftware

New Zenner

Join Date:
Apr 2011
Posts:
93
Plugin Contributions:
1

Re: Facebook - eCommerce Catalog Browse [Support]

Hi,

Sorry the documentation is not up to date; we have been continually adding features during the past month based on people's feedback, and we want to update the documentation in one go.

As we make new functionality available we need to update the data-feed to allow the app to make use of these functions. This is the case for the in-stock option you have enquired about. You would need to upgrade to the latest version of the Zen cart add-on to access this functionality. You are currently using v1.3
Faceobook add-on Page

The display ##########_ button and check box, allow you to customise the text displayed in the button next to each product. The check-box allows you to enable this feature. E.g. a "Buy" button:

The image upload option has been temporarily remove due to a technical issue caused when the system attempts to auto resize. We are looking into ways around this and hope that it can be restored prior to the end of the beta.

RE: the different views on fb. This took us a while to understand too!
If you are using facebook as page:
The 'News' view for your fb page should be displaying posts made by your page, and any other pages that your page follows.
The 'Wall' view for your fb page will show any posts that your page makes, as well as any posts that your 'fans' post on your wall.
These are different views, and you would not expect to see posts on the 'wall' made by a fan to be visible in your 'News' feed, (unless they posted a comment on one of the posts made by your 'page').
If you are using facebook as user:
The 'home' or 'news' view will show all of your personal posts and posts of the pages and people you follow (including your store, I imagine!).
The 'wall' view for your business 'page' will show the wall for your business. Here, you should see all posts made by the business, plus any posts made by other fans, including yourself (as a 'user').

Cheers

Bright Software Solutions

27 May 2011, 4:06 PM
#54
cooler0918 avatar

cooler0918

New Zenner

Join Date:
Apr 2011
Posts:
26
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Understood, but here is the strange thing using fb as user not page the post from both user and page do not show up on news feed most recent. However on news feed top news the user (me) can see the post from page but not the post from user.

Separate user which is a friend and a fan of the page. They don't see anything on news feed most recent, but can see the post from user(me) not page on news feed top new. :mellow:

Thank you
http://www.ahaccessories.com

27 May 2011, 4:18 PM
#55
cooler0918 avatar

cooler0918

New Zenner

Join Date:
Apr 2011
Posts:
26
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

Ok, shared an other as page not user and I can see the same thing. on user(me) nothing on news feed most recent, but I see it from page on news feed top news.

Same for second user.

now I am going to share from news feed top news user(me) what I see from page. and I can't cause i only have a like or comment option.

Not sure if this is how it is intended to work.

Thanks
http://www.ahaccessories.com

27 May 2011, 5:25 PM
#56
brightsoftware avatar

brightsoftware

New Zenner

Join Date:
Apr 2011
Posts:
93
Plugin Contributions:
1

Re: Facebook - eCommerce Catalog Browse [Support]

Sorry, I'm not sure that I follow what you are trying to explain. It could be due to the news feed taking a while to update. Alternatively, I have also noticed that it sometimes groups posts from the same app, with a link saying view more post by this app (this is a facebook functionality, not an app functionality). Could this be what you are seeing?

The 'share' link in the app launches the default Facebook share window and the rest is handled by Facebook so I can't change the functionality on that.

As an aside, have you 'liked' your own page (i.e. does the user (you) 'like' the page?) - as this would mean that you would not see any of the posts that the page is making.

2 Jun 2011, 11:09 AM
#57
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

New to FaceBook eCommerce, so hoping someone might be able to help me out here.

I've installed this mod and it's doing exactly what it's supposed to but I was hoping to custominse the PHP file that ships with it to exclude a specific category from the feed.

Does anyone know what to add to the PHP file and where to add it, so that the products from cPath=1_350 do not get fed through to Facebook?

The reason I want these poducts excluded is that they're customer specific orders, set up as packages. They're of no value to potential customers and they need not appear.

Any help would be greatly appreciated.

2 Jun 2011, 11:36 AM
#58
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

I think know the snippet of code to use, not not sure where to insert this:

$where_str .= " AND p.master_categories_id != 350 ";

Any ideas?

2 Jun 2011, 11:51 AM
#59
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Facebook - eCommerce Catalog Browse [Support]

For any guru's who might be passing through, here is a copy/paste of the datafeed that ships with this mod. I just need to know how to exclude my hidden products category cPath=1_350

<?php
 /*

	Facebook Catalog Browser - Zencart Plugin
	This modules allow Bright Software Solutions Facebook App to collect
	a list of products and categories. To allow access to this functionality
	the user needs to enter a secure key in the Module settings.
	This key is then used when setting up the App on your Facebook page.
	
	Copyright (C) 2011 Bright Software Solutions
						http://www.brightsoftwaresolutions.com
	
	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 */

  require('includes/application_top.php');
  
   define('App_DefaultCategoryID',0);
   define('App_PageSize',30);
   
   define('App_NewProductsMax',60);
   
   if (!isset($_GET['n']) || !isset($_GET['p'])) {
		die('Illegal Access Detected');  
   }
   $admin_name = $_GET['n'];
   $admin_pass = $_GET['p'];
   
   if (!isset($_GET['t'])) {
		$type = 'N'; //default new products
	} else {
		$type =  $_GET['t'];
	}
  
   if (!isset($_GET['catid'])) {
	$catid = App_DefaultCategoryID; //default to root cat
	} else {
		if (is_numeric($_GET['catid'])) {
			$catid = $_GET['catid'];
		} else {
			$catid = App_DefaultCategoryID;
		}
	}
	
   if ($catid<0) $catid =App_DefaultCategoryID;
   
   if (!isset($_GET['path'])) {
		$path = $catid;
	} else {				
		$path = $_GET['path'];
	}
	
   if (!isset($_GET['page'])) {
		$page = 0;
	} else {				
		if (is_numeric($_GET['page'])) {
			$page = $_GET['page'];
		} else {
			$page = 0;
		}	
	}
   
	$instock = true;
	if (isset($_GET['instock'])) {
		if ($_GET['instock']=="0" || $_GET['instock']=="false") {
			$instock = false;
		} 		
	}
   
   if (!($admin_name =='zc_browse')) {
		die('Illegal Access Detected');   
   }
   if (!($admin_pass == BSS_PLUGIN_KEY)) {
		die('Illegal Access Detected');   
   }
   
   if (isset($_GET['validate'])) {   
	   $validate = $_GET['validate'];
	   if ($validate=='connection') {
			die('True');
	   }
	   
	   if ($validate=='plugin_version') {
			die('1.7');
	   }
	    if ($validate=='plugin_type') {
			die('ZenCart');
	   }
   }
   
   if (isset( $_GET['lang'])) {	
		$language = $_GET['lang'];		
   } else {   
		$language = DEFAULT_LANGUAGE;
   }
   
   // Lookup Language ID
  $query = "SELECT languages_id FROM " . TABLE_LANGUAGES . " l where code ='" . str_replace("'","",$language) ."'";
  $currency = $db->Execute($query);
  if (!$currency->EOF) {
	$language_id = $currency->fields['languages_id'];
  } else {
	 $language_id=1;
  }
  
   
   if (isset( $_GET['rt'])) {	
		$requesttype = $_GET['rt'];
   } else {   
		$requesttype ='P';
   }
   
   if  ($requesttype=='C') {
   		
     	$query = "SELECT c.categories_id,categories_name  FROM " . TABLE_CATEGORIES ." c, " . TABLE_CATEGORIES_DESCRIPTION . " cd  where
				c.categories_id  = cd.categories_id and parent_id=" . App_DefaultCategoryID . " and categories_status=1 
				and cd.language_id = " . $language_id . " order by sort_order ";
   } else {
	
	 $query_Tables ="";
	 $query_Order = " pd.products_name";
	 
	 $query_Limit_Offset = App_PageSize * $page;	 
	 $query_Limit = " limit " . $query_Limit_Offset . "," . App_PageSize;
	 
	 if ($catid<=0){ 
	 	$query_Where = "";
	 } else {
		$query_Tables .=  ", " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ";
		$query_Where = " and p2c.products_id = p.products_id and (p2c.categories_id = " .	 $catid;
		$subcategories_array = array();
		zen_get_subcategories($subcategories_array, $catid);
	    for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
	      $query_Where .= " OR p2c.categories_id  = '" .  $subcategories_array[$i] ."'";
	    }
        $query_Where .= " ) ";
		
	 }
	 switch (strtoupper($type)) {
		case 'N':
			//New Products
			 $query_Where .= "";
			 $query_Order = " p.products_date_added desc ";
			break;
		case 'S':
			//Special Offers
			 $query_Where .= " and s.specials_id is not	null ";
			break;
		case 'F':
			//Featured
			$query_Tables .= ", " . TABLE_FEATURED ." f ";
			$query_Where .= " and f.products_id=p.products_id and f.status=1 
						and (now() > f.featured_date_available or f.featured_date_available='0001-01-01')
						and (now() < f.expires_date or f.expires_date='0001-01-01')";
			break;
		//case 'A':
			//All Products
		//	break;
	}
	 
	if ($instock) {
		$query_Where = " and p.products_quantity>0 " . $query_Where;
	}
	 
		$query_total = "Select distinct count(p.products_id) as rcount FROM 
							" . TABLE_PRODUCTS . " p ";
		if (strtoupper($type)=='S')	{
			$query_total .=	" left outer join " . TABLE_SPECIALS . " s on s.status=1 and p.products_id=s.products_id
								and (now() > s.specials_date_available or s.specials_date_available='0001-01-01')
								and (now() < s.expires_date or s.expires_date='0001-01-01')";
		}
		$query_total .=	 $query_Tables . "
						WHERE 
							p.products_status=1 " . $query_Where;
	 
		
		 $data_query = $db->Execute($query_total);
		// print_r( $data_query);
		 $Product_Count =$data_query->fields['rcount'];
		 //Limit New Product to App_NewProductsMax Newest
		 if (strtoupper($type)=='N' && $Product_Count>App_NewProductsMax) {		
			 $Product_Count =App_NewProductsMax;
		}
		
			
		if (DISPLAY_PRICE_WITH_TAX=='true') {
			$Query_SelectTax = ",tr.tax_rate ";
			$Query_TableTax = " left outer join " . TABLE_TAX_RATES ." tr on tr.tax_class_id = p.products_tax_class_id ";
		} else {		
			$Query_SelectTax = ",0.0 as tax_rate ";
			$Query_TableTax = " ";
		}
	
		 
		$query = "SELECT distinct p.products_id,pd.products_name,p.products_price,s.specials_new_products_price,p.products_image" . $Query_SelectTax ." 
				FROM 
					" . TABLE_PRODUCTS . " p inner join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id=p.products_id and pd.language_id = '" . $language_id . "'
					" . $Query_TableTax ."
					left outer join " . TABLE_SPECIALS . " s on s.status=1 and p.products_id=s.products_id
						and (now() > s.specials_date_available or s.specials_date_available='0001-01-01')
						and (now() < s.expires_date or s.expires_date='0001-01-01')
					" . $query_Tables . "
				WHERE 
					p.products_status=1 " . $query_Where . " order by  " . $query_Order . $query_Limit;
		
 }
	
  $data_query = $db->Execute($query);
?>
<?php
  $Currency_Prefix = "";
  $dp = 2;
  $query = "SELECT symbol_left,symbol_right,decimal_places FROM " . TABLE_CURRENCIES . " c where code ='" . DEFAULT_CURRENCY  ."'";
  $currency = $db->Execute($query);
  while (!$currency->EOF) {
	$Currency_Prefix = $currency->fields['symbol_left'];
	$Currency_Postfix =  $currency->fields['symbol_right'];
	$dp = $currency->fields['decimal_places'];
    $currency->MoveNext();
  }
  if ($Currency_Prefix =='£')  $Currency_Prefix = '£';
  if ($Currency_Prefix =='€')  $Currency_Prefix = '€';
    
  if ($Currency_Postfix =='£')  $Currency_Postfix = '£';
  if ($Currency_Postfix =='€')  $Currency_Postfix = '€';
  
  $format =  "%.". $dp ."f";
  $cat_paths = explode("-", $path);
  $rows = array();
  while (!$data_query->EOF) {	
	if  ($requesttype=='P') {
		$price = $data_query->fields['products_price'];	
		$price_special = $data_query->fields['specials_new_products_price'];
		if (DISPLAY_PRICE_WITH_TAX=='true') {	
			$tax_rate = $data_query->fields['tax_rate'];	
			if (isset($tax_rate) && $tax_rate>0) {
				$price = $price * (1 + ($tax_rate/100));		
				if ($price_special) {
					$price_special = $price_special * (1 + ($tax_rate/100));			
				}
			}
		} 
		$data_query->fields['products_price'] = $Currency_Prefix . sprintf($format, round($price,$dp)) . $Currency_Postfix;
		if ($price_special) {
			$data_query->fields['specials_new_products_price'] =$Currency_Prefix . sprintf($format, round($price_special,$dp)) . $Currency_Postfix;
		}
	}
	$datafields = $data_query->fields;
	if  ($requesttype=='C' && App_DefaultCategoryID!=$catid && in_array($data_query->fields['categories_id'],$cat_paths)) { //$data_query->fields['categories_id']==$catid) {
		 	$queryChildren = "SELECT c.categories_id,categories_name  FROM " . TABLE_CATEGORIES ." c, " . TABLE_CATEGORIES_DESCRIPTION . " cd  where
				c.categories_id  = cd.categories_id and parent_id=" . $data_query->fields['categories_id'] . " and categories_status=1 and cd.language_id = " . $language_id . " order by sort_order ";
 			$data_subquery = $db->Execute($queryChildren);
 			$rowschild = array();
 			 while (!$data_subquery->EOF) {
				$rowschild[] = $data_subquery->fields;
    			$data_subquery->MoveNext();
    		}
	 		$datafields['childern'] = $rowschild;
	}
	$rows[] = $datafields;
    $data_query->MoveNext();
  }
  
     //JSON_ENCODE Alternative used if not already installed on system.   
   if (!function_exists('json_encode'))
	{
	  $encoder ='local';
	  function json_encode($a=false)
	  {
	    if (is_null($a)) return 'null';
	    if ($a === false) return 'false';
	    if ($a === true) return 'true';
	    if (is_scalar($a))
	    {
	      if (is_float($a))
	      {
	        // Always use "." for floats.
	        return floatval(str_replace(",", ".", strval($a)));
	      }
	      if (is_string($a))
	      {
	        static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
	        return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
	      }
	      else
	        return $a;
	    }
	    $isList = true;
	    for ($i = 0, reset($a); $i < count($a); $i++, next($a))
	    {
	      if (key($a) !== $i)
	      {
	        $isList = false;
	        break;
	      }
	    }
	    $result = array();
	    if ($isList)
	    {
	      foreach ($a as $v) $result[] = json_encode($v);
	      return '[' . join(',', $result) . ']';
	    }
	    else
	    {
	      foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
	      return '{' . join(',', $result) . '}';
	    }
	  }
	}  else {
		$encoder ='system';
	}
	
	function is_utf8($str) {
    $c=0; $b=0;
    $bits=0;
    $len=strlen($str);
    for($i=0; $i<$len; $i++){
        $c=ord($str[$i]);
        if($c > 128){
            if(($c >= 254)) return false;
            elseif($c >= 252) $bits=6;
            elseif($c >= 248) $bits=5;
            elseif($c >= 240) $bits=4;
            elseif($c >= 224) $bits=3;
            elseif($c >= 192) $bits=2;
            else return false;
            if(($i+$bits) > $len) return false;
            while($bits > 1){
                $i++;
                $b=ord($str[$i]);
                if($b < 128 || $b > 191) return false;
                $bits--;
            }
        }
    }
    return true;
	}

	function utf8json($inArray) { 
	    static $depth = 0; 
	    /* our return object */ 
	    $newArray = array(); 
	    /* safety recursion limit */ 
	    $depth ++; 
	    if($depth >= '100') { 
	        return false; 
	    } 
	    /* step through inArray */ 
	    foreach($inArray as $key=>$val) { 
	        if(is_array($val)) { 
	            /* recurse on array elements */ 
	            $newArray[$key] = utf8json($val); 				
	        } else { 
	            /* encode string values */ 				
				if ($val==null) {
					$newArray[$key] = null;
				} else {		
					if (is_utf8($val)) { 
						$newArray[$key] =$val;
					} else {
						$newArray[$key] = utf8_encode($val); 
					}
				}
	        } 
	    } 
	    /* return utf8 encoded array */ 
	    return $newArray; 
} 
  
    if  ($requesttype=='C') {
		print json_encode(utf8json($rows));
	} else {
		$Category = array();
		$Category['rcount'] = $Product_Count;
		$Category['products'] = utf8json($rows);
		$Category['encode'] = $encoder;
		print json_encode($Category);
	}
?>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
2 Jun 2011, 12:06 PM
#60
brightsoftware avatar

brightsoftware

New Zenner

Join Date:
Apr 2011
Posts:
93
Plugin Contributions:
1

Re: Facebook - eCommerce Catalog Browse [Support]

Hi

If you add the line after:

 if ($instock) {
        $query_Where = " and p.products_quantity>0 " . $query_Where;
    } 

e.g.

 if ($instock) {
        $query_Where = " and p.products_quantity>0 " . $query_Where;
    } 

 $query_Where .= " AND p.master_categories_id != 350 ";

it should then make sure that no products from this category are included any of the data feeds.

Cheers
Bright Software Solutions