Disable Google Checkout for Certain Product Categories?

1 view
Skip to first unread message

Sunshine

unread,
Aug 15, 2007, 10:23:56 AM8/15/07
to Google Checkout Mod for Zen Cart Community Support Forum
I have a catalog and Google tells me that some of my items violate
their terms because they are lock picking devises.

Is there a way on Zen Cart to add a parameter to each item (or within
the MySQL) so that the Google Checkout is disabled if that product is
in the shopping cart?

This should satisfy the requirements Google are asking me to fulfill.

Ropu

unread,
Aug 15, 2007, 11:21:13 AM8/15/07
to google-checkout-for-...@googlegroups.com
Hi, right now there is no possibility for that.

but u may add some code to the googlecheckout/gcheckout.php
between lines 126 and 215 the items in the ZC cart are added to the GC one. There u should have all the necessary info about the items. So u can check if they belong to a particular category and gray the button with this code

  $Gcart->SetButtonVariant(false);
  $Gwarnings[] = "Some products in the cart are not available with GC, etc";


Hope this helps

ropu
--
.-. --- .--. ..-
R  o  p  u

twynn

unread,
Aug 23, 2007, 6:05:57 PM8/23/07
to Google Checkout Mod for Zen Cart Community Support Forum
I have successfully installed Google Checkout Mod v1.4beta1 on
ZenCart 1.37 and am pleased with the initial results; however, we have
two categories in our shop, securitybsafe.com/shop/, with products
that do not comply with Google content policies, therefore, I had to
disable the Google Checkout Mod until a reasonable solution is found.

What we need to do is place the Google-hosted 'not available' button
for categories/products
that are restricted under Googles policies. Please note that my PHP
knowledge is very limited but maybe I'm on the rite track. With a
little help this could be solved or not?

What I have learned.

1.) By replacing 'XXX' with our Google merchant ID in the URL below,
the Google-hosted 'not available' button will display in my browser.
http://checkout.google.com/buttons/checkout.gif?merchant_id=XXX&w=180...
tyle=white&variant=disabled&loc=en_US


2.) The code below is on line 287 in file gcheckout.php. Maybe
something similar to this code example could be used except with
the restricted master_categories_id or product_id and placed in
gcheckout.php
somewhere? Ive tried to do this but with no success.

if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($flagAnyOutOfStock ==
true) ) {
$Gcart->SetButtonVariant(false);
$Gwarnings[] = GOOGLECHECKOUT_STRING_WARN_OUT_OF_STOCK;

}

Thanks

Tom

On Aug 15, 10:21 am, Ropu <rovagn...@gmail.com> wrote:
> Hi, right now there is no possibility for that.
>
> but u may add some code to the googlecheckout/gcheckout.php
> between lines 126 and 215 the items in the ZC cart are added to the GC one.
> There u should have all the necessary info about the items. So u can check
> if they belong to a particular category and gray the button with this code
>
> $Gcart->SetButtonVariant(false);
> $Gwarnings[] = "Some products in the cart are not available with GC, etc";
>
> Hope this helps
>
> ropu

Ropu

unread,
Aug 23, 2007, 6:18:11 PM8/23/07
to google-checkout-for-...@googlegroups.com
A quick fix may be this one.

in file googlecheckout/gcheckout.php line 215

replace:

  $product_list .= ";".(int)$products[$i]['id'];

with:

  $product_list .= ";".(int)$products[$i]['id'];
  if(in_array($products[$i]['category'], $resticted_categories)) {
    $Gcart->SetButtonVariant(false);
    $Gwarnings[] = 'Some items are in restricted category...';
  }

and in line 125

replace:

$look4Attr = array('TEXT');

with:

$look4Attr = array('TEXT');
// Restricted categories
$resticted_categories = array(9,12,32);

where  9,12,32 are the ids of the restricted categories.

Just note that GC Policy says that 95% of the time, the GC button MUST be enabled
http://checkout.google.com/support/sell/bin/answer.py?answer=46174&topic=8681

next version will allow categories to be set in the Admin UI

ropu

twynn

unread,
Aug 24, 2007, 12:41:17 PM8/24/07
to Google Checkout Mod for Zen Cart Community Support Forum
R o p u
This code worked perfectly. Thank you very much!
We do comply with the 95% policy. We have seven out 173 products in
our catalog that are restricted.
95% of 173 products is 164.35 which would allow us eight. Of coarse
this will depend on further review by
Google I'm sure.. Thanks again..

Tom

On Aug 23, 5:18 pm, Ropu <rovagn...@gmail.com> wrote:
> A quick fix may be this one.
>
> in file googlecheckout/gcheckout.php line 215
>
> replace:
>
> $product_list .= ";".(int)$products[$i]['id'];
>
> with:
>
> $product_list .= ";".(int)$products[$i]['id'];
> if(in_array($products[$i]['category'], $resticted_categories)) {
> $Gcart->SetButtonVariant(false);
> $Gwarnings[] = 'Some items are in restricted category...';
> }
>
> and in line 125
>
> replace:
>
> $look4Attr = array('TEXT');
>
> with:
>
> $look4Attr = array('TEXT');
> // Restricted categories
> $resticted_categories = array(9,12,32);
>
> where 9,12,32 are the ids of the restricted categories.
>
> Just note that GC Policy says that 95% of the time, the GC button MUST be

> enabledhttp://checkout.google.com/support/sell/bin/answer.py?answer=46174&to...

Ropu

unread,
Aug 24, 2007, 4:12:47 PM8/24/07
to google-checkout-for-...@googlegroups.com
;)

cool, new version is on the way, maybe next week, and will have this feature. It will be configurable from the admin UI

thx for the feedback

ropu
Reply all
Reply to author
Forward
0 new messages