Rank: Member
Joined: 1/19/2005(UTC) Posts: 49
|
Is there a was to keep certain products from going into the product feed? |
Thanks Matt |
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Originally Posted by: toolsup Is there a was to keep certain products from going into the product feed? Enter the power of the feed engine! Do you want to exclude the same products from all product feeds or just certain ones? |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 1/19/2005(UTC) Posts: 49
|
Just certain products. All feeds. Maybe just a "Exclude from Feeds" checkbox on the product edit page, batch edit page and part of the import. |
Thanks Matt |
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Create a Multiple Choice type property called something like "Include in Feeds" with values "Yes" and "No". You'll also want to set the default value, presumably "Yes", but highlighting it. Next assign this Type Property each of your Product Types. Next add the following line of code after line 53 of the /App_Code/FeedEngine/BaseProductFeed.vb file: Code:
psc.CustomProperties.Add(New Catalog.ProductSearchCriteria.CustomPropertyValue("multiple-choice-type-property-bvin", "Yes"))
Note that you'll need to get the bvin value of the Type Property that you created in the admin. The easy way to do this is to edit the Type Property (after you've saved it) and look at the id value in the query string of the URL. Copy/paste that value into the code and replace "multiple-choice-type-property-bvin". Be sure to retain the quotes around your bvin value or you will get an error. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
Aaron, Is there a way to add this to the product filter? Can it be added to the search criteria? I need to filter a product type property. If the property is set to yes, then export those products. I can add and remove that chunk of code every time I want to do this, but it would be easier when other people need to export products. Even if it just can be added to the product export page under Include Choice Options as a checkbox (I may have asked this before) Edited by user Tuesday, October 28, 2014 1:08:06 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
This could probably be done with some customization, but it is not currently supported. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
Hmmm actually I can't get this to work with the feed engine. Edited by user Tuesday, October 28, 2014 5:05:08 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Aaron Create a Multiple Choice type property called something like "Include in Feeds" with values "Yes" and "No". You'll also want to set the default value, presumably "Yes", but highlighting it. Next assign this Type Property each of your Product Types. Next add the following line of code after line 53 of the /App_Code/FeedEngine/BaseProductFeed.vb file: Code:
psc.CustomProperties.Add(New Catalog.ProductSearchCriteria.CustomPropertyValue("multiple-choice-type-property-bvin", "Yes"))
Note that you'll need to get the bvin value of the Type Property that you created in the admin. The easy way to do this is to edit the Type Property (after you've saved it) and look at the id value in the query string of the URL. Copy/paste that value into the code and replace "multiple-choice-type-property-bvin". Be sure to retain the quotes around your bvin value or you will get an error. Figured it out... you need the bvin for both the type property and the value. "Yes" will not work.
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Originally Posted by: sternyy Figured it out... you need the bvin for both the type property and the value. "Yes" will not work. Doh! That's what I get for posting untested code. I had a feeling that might be the problem. Good job! |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
I think my original code snippet would work with a "Text" Type Property. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
Aaron, Does this also affect the sitemap feed? We only want to select products to be excluded from the google shopping feed, not the sitemap feed.
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Originally Posted by: sternyy Does this also affect the sitemap feed? We only want to select products to be excluded from the google shopping feed, not the sitemap feed. Yes. To only affect the Google Shopping feed you will need to edit that feed rather than BaseProductFeed. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
1 user thanked Aaron for this useful post.
|
|
|
Rank: Member
Joined: 1/10/2005(UTC) Posts: 714
Thanks: 14 times Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
Rank: Member
Joined: 8/24/2017(UTC) Posts: 1 Location: Erie
|
1. I created a Multiple Choice type property called "Include in Feeds" with values "Yes" and "No". I set the default value, to "Yes", by highlighting it. 2. Next, I assign this Type Property to each of our Product Types. 3. Then I added the following code to the BaseProductFeed.vb (Custom Product Added by .... )
Public Overridable ReadOnly Property Products() As Collection(Of Catalog.Product) Get If Me._Products Is Nothing OrElse Me._Products.Count = 0 Then Me._Products = New Collection(Of Catalog.Product)
Dim psc As New Catalog.ProductSearchCriteria() 'Custom Property Added by ...... 8/22/2017 psc.CustomProperties.Add(New Catalog.ProductSearchCriteria.CustomPropertyValue("1efcbd86-ea70-4c53-90dc-ca93e98487e8", "c102a62a-fac7-48c8-afef-f716c6c5e735")) 'Property_Type_Bvin Include in Feed '1efcbd86-ea70-4c53-90dc-ca93e98487e8' 'Property_Choice_bvin Result (Yes) 'c102a62a-fac7-48c8-afef-f716c6c5e735' 'End Custom Property Added
psc.DisplayInactiveProducts = False psc.Status = Catalog.ProductStatus.Active psc.SpecialProductTypeOne = Catalog.SpecialProductTypes.Normal ' excludes kits & gift certificates
However, this does not seem to work. We are going to have Aaron look into doing a custom mod for us. Just so someone doesn't spend a lot of time trying to get this to work... Talk with Aaron first.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.