[Skip to main content](#vessel-content)

#   Select category to use for Google products plugin

##

- **[deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")**
- [![deuce4884's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38332-deuce4884 "View deuce4884's Profile") Topic Author
- [ Offline](/forum/user/38332-deuce4884)

Less More

- Posts: 128
- Thank you received: 3
-
-

10 years 7 months ago [\#234734](#234734) by [deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")  *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#234734 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")* was created by *[deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.24

Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

10 years 7 months ago [\#234750](#234750) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#234750 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")*

Hi,

Sure.
You want to edit the file plugins/hikashop/google_products/google_products.php and for example, you could change the line:
$queryCategoryId = 'SELECT * FROM '.hikashop_table('product_category').' WHERE product_id IN ('.implode(',',$ids).')';
to:
$queryCategoryId = 'SELECT * FROM '.hikashop_table('product_category').' WHERE product_id IN ('.implode(',',$ids).') AND category_id NOT IN( XXX, YYY, ZZZ )';

Then, the categories XXX, YYY and ZZZ wouldn't be used in the XML feed.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")**
- [![deuce4884's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38332-deuce4884 "View deuce4884's Profile") Topic Author
- [ Offline](/forum/user/38332-deuce4884)

Less More

- Posts: 128
- Thank you received: 3
-
-

10 years 7 months ago [\#234812](#234812) by [deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")  Replied by *[deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")* on topic *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#234812 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")*

Ok I gotcha on this. I have different prices for different user groups for each product, such as dealer prices and regular customer prices. I need to make this plugin where it will only retrieve products with prices for user groups I select. I added this field to the xml file
Code:

&lt;param name="price_access" type="sql" default="" label="User group prices" description="Choose the group prices that you want displayed in your feed." query="SELECT id AS value, title AS title FROM #__usergroups" multiple="multiple" /&gt;

How can I use this to where it will only show products where the prices equal the user groups I select?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

10 years 7 months ago [\#234833](#234833) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#234833 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")*

That's quite complex as the system isn't supposed to handle that.
It automatically takes the prices of the user who is logged in and is generating the XML.
I would recommend to simply create a user with the user groups you want and access to the backend and then generate the XML manually with that user.

Otherwise, you would have to directly modify the function hikashop_addACLFilters in the file administrator/components/com_hikashop/helpers/helper.php which is the function used everywhere to handle user groups restrictions.
So you would need your plugin to set a global variable, for example in the $_SESSION, and then check it in that function to force the user groups check, and then unset it in the $_SESSION in the plugin before existing.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")**
- [![deuce4884's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38332-deuce4884 "View deuce4884's Profile") Topic Author
- [ Offline](/forum/user/38332-deuce4884)

Less More

- Posts: 128
- Thank you received: 3
-
-

10 years 7 months ago [\#234921](#234921) by [deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")  Replied by *[deuce4884](/forum/user/38332-deuce4884 "View deuce4884's Profile")* on topic *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#234921 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")*

I'm logged in as the superuser when generating configuring this plugin and generating the xml and it is taking the prices from my dealer price access not the superuser. Why is it not using my superuser prices if I'm logged in as the superuser?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

10 years 7 months ago [\#234941](#234941) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#234941 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")*

You're right, I forgot a condition.

In the code of the plugin, you can change the call to the getListingPrices function and add a fifth parameter witht he id of the user for which you want to load the prices.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

10 years 1 month ago -  10 years 1 month ago [\#251488](#251488) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#251488 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")*

Hika 2.6.4.
Joomla 3.6.2
Code:

Hi, Sure. You want to edit the file plugins/hikashop/google_products/google_products.php and for example, you could change the line: $queryCategoryId = 'SELECT * FROM '.hikashop_table('product_category').' WHERE product_id IN ('.implode(',',$ids).')'; to: $queryCategoryId = 'SELECT * FROM '.hikashop_table('product_category').' WHERE product_id IN ('.implode(',',$ids).') AND category_id NOT IN( XXX, YYY, ZZZ )'; Then, the categories XXX, YYY and ZZZ wouldn't be used in the XML feed.

I don't get this. Should XXX, YYY be the ID of the categories I want to exclude from the Google feed ?

Last edit: 10 years 1 month ago by [river](/forum/user/9591-river "View river's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 1 month ago [\#251491](#251491) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Select category to use for Google products plugin](/forum/30-integrations/883461-select-category-to-use-for-google-products-plugin#251491 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1 -- PHP version -- : 5.3.24  Is there a way I can modify the Google products plugin to where I can select what product categories to use for my feed instead of using all of them?")*

Hi,

Yes ; that's what Nicolas wrote and that's what the SQL query is saying too.
" category_id NOT IN (x, y, z) " means that the category_id should not be in the list.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMwLWludGVncmF0aW9ucy84ODM0NjEtc2VsZWN0LWNhdGVnb3J5LXRvLXVzZS1mb3ItZ29vZ2xlLXByb2R1Y3RzLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.072 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
