Post by elskorco » Tue Nov 15, 2016 5:56 pm

Hy,
I enabled the google base feed and I would like that it takes only in stock products to the feed....
I looked into the code

Code: Select all

$output .= '<g:availability><![CDATA[' . ($product['quantity'] ? 'in stock' : 'out of stock') . ']]></g:availability>';
Is there anything I can do to that code? Or any other option?
Thank you very much!

Newbie

Posts

Joined
Tue Nov 15, 2016 5:53 pm

Post by thekrotek » Wed Nov 16, 2016 5:12 am

Try to replace this:

Code: Select all

if (!in_array($product['product_id'], $product_data) && $product['description']) {
with this:

Code: Select all

if (!in_array($product['product_id'], $product_data) && $product['description'] && $product['quantity']) {

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by elskorco » Sat Nov 19, 2016 4:30 pm

thank you!!! :ok:
I will try it.. have a nice day and weekend!

Newbie

Posts

Joined
Tue Nov 15, 2016 5:53 pm

Post by uksitebuilder » Sat Nov 19, 2016 4:55 pm

It is probably a bad idea to do that

Why ?

Example
Day 1
You submit a feed with 10 products (These will stay on Google Shopping for 30 days until they expire)

Day 2
1 of those products sold out and new feed is submitted now with only 9 products

The product that is now missing from the feed is still on Google Shopping and still shows a status of 'In Stock'

Google will disapprove it

Get too many Disapprovements and Google will suspend your account

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by elskorco » Sat Nov 19, 2016 7:51 pm

thx for your reply uksitebuilder
I dont need it for google, but for an price comparison www site here in Slovenia (ceneje.si), I dont plan to publish this feed on google

@thekrotek
the modifications should be only made in the controller map? not in the admin map right?

Newbie

Posts

Joined
Tue Nov 15, 2016 5:53 pm

Post by elskorco » Sat Nov 19, 2016 8:01 pm

it works! thank you so so much thekrotek!
:yahoo:

have a nice weekend thekrotek and uksitebuilder!

Newbie

Posts

Joined
Tue Nov 15, 2016 5:53 pm
Who is online

Users browsing this forum: No registered users and 1 guest