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

#   how to remove the first category from Google Product Feed

##

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

Less More

- Posts: 343
- Thank you received: 28
-
-
- [](http://www.delinie-ict.nl)
-

4 years 6 months ago -  4 years 6 months ago [\#341089](#341089) by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")  *[how to remove the first category from Google Product Feed](/forum/30-integrations/904306-how-to-remove-the-first-category-from-google-product-feed#341089 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.2 -- PHP version -- : 8.0  Hi, Is it doable to have the first category removed from the product&#95;type field in the Google Product Feed?  Or have some sort of search / replace option for these fields?  I understand this needs some PHP work done by a programmer but I'm just trying to see if it's possible and maybe some tips to get started in the right direction :)  Thanks.")* was created by *[nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")*

-- HikaShop version -- : 4.5.1
-- Joomla version -- : 4.1.2
-- PHP version -- : 8.0

Hi,
Is it doable to have the first category removed from the product_type field in the Google Product Feed?

Or have some sort of search / replace option for these fields?

I understand this needs some PHP work done by a programmer but I'm just trying to see if it's possible and maybe some tips to get started in the right direction ![:)](/media/kunena/emoticons/3.png ":)")

Thanks.

Last edit: 4 years 6 months ago by [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile"). Reason: solved

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQzMDYtaG93LXRvLXJlbW92ZS10aGUtZmlyc3QtY2F0ZWdvcnktZnJvbS1nb29nbGUtcHJvZHVjdC1mZWVkP3RtcGw9bWFya2Rvd24=) 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: 86540
- Thank you received: 14300
-
-

4 years 6 months ago [\#341093](#341093) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[how to remove the first category from Google Product Feed](/forum/30-integrations/904306-how-to-remove-the-first-category-from-google-product-feed#341093 "-- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.2 -- PHP version -- : 8.0  Hi, Is it doable to have the first category removed from the product&#95;type field in the Google Product Feed?  Or have some sort of search / replace option for these fields?  I understand this needs some PHP work done by a programmer but I'm just trying to see if it's possible and maybe some tips to get started in the right direction :)  Thanks.")*

Hi,

Removing the first category from the product_type should be quite easy for a developer.
In the file plugins/hikashop/google_products.php you have that code: Code:

foreach($product-&gt;categories_id as $catID){ foreach($category_path as $id=&gt;$catPath){ if($id == $catID){ if(strlen($type.str_replace(',', ' ', $catPath['path']).',') &gt; 750) continue; $type .= str_replace(',', ' ', $catPath['path']).','; } } }

to skip the first category, you could replace that code by: Code:

$first = true; foreach($product-&gt;categories_id as $catID){ foreach($category_path as $id=&gt;$catPath){ if($id == $catID){ if($first) { $first = false; continue; } if(strlen($type.str_replace(',', ' ', $catPath['path']).',') &gt; 750) continue; $type .= str_replace(',', ' ', $catPath['path']).','; } } }

Now please remember that this file will be overwritten each time you update HikaShop. So you'll loose your changes there and you'll have to redo them.

The following user(s) said Thank You: [nico.van.leeuwen](/forum/user/12404-nico-van-leeuwen "View nico.van.leeuwen's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ludGVncmF0aW9ucy85MDQzMDYtaG93LXRvLXJlbW92ZS10aGUtZmlyc3QtY2F0ZWdvcnktZnJvbS1nb29nbGUtcHJvZHVjdC1mZWVkP3RtcGw9bWFya2Rvd24=) 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.050 seconds

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