We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi,

    I have a bunch of products, all with a product code.
    I want to show a list of associated products under each product where applicable.

    So i thought using getresources with TV filters.

    So I tried:
    29 = the ID of the main products section
    groupedProducts = the name of the TV where the list of values will be (which is an autotag field)

    So the contents of that field would be something like: 11111,22222,33333

    Which should output all products


    [[getResources?
    &tpl=`groupedProductsTpl`
    &parents=`29`
    &tvFilters=`product_code==[[*groupedProducts]]`
    &processTVs=`1`
    &includeTVs=`1`
    ]]

    The problem I have is that I'm using simplecart, and the product_code isn't an actual TV - so I'm not sure how to hook into it! If I try a real TV it works - any ideas anyone?

    Thanks
    Andy
      • 51020
      • 670 Posts
      Quote from: tm2000 at Jun 24, 2016, 04:57 AM
      Hi,

      I have a bunch of products, all with a product code.
      I want to show a list of associated products under each product where applicable.

      So i thought using getresources with TV filters.

      So I tried:
      29 = the ID of the main products section
      groupedProducts = the name of the TV where the list of values will be (which is an autotag field)

      So the contents of that field would be something like: 11111,22222,33333

      Which should output all products


      [[getResources?
      &tpl=`groupedProductsTpl`
      &parents=`29`
      &tvFilters=`product_code==[[*groupedProducts]]`
      &processTVs=`1`
      &includeTVs=`1`
      ]]

      The problem I have is that I'm using simplecart, and the product_code isn't an actual TV - so I'm not sure how to hook into it! If I try a real TV it works - any ideas anyone?

      Thanks
      Andy

      Further to this, I can't get the tvfilter to work when there is more than one value. What I want to do is use the comma seperated list of tags (product codes) to match up with the actual product codes of the resources, to output the list.
        • 51020
        • 670 Posts
        I've had a rethink on this - Forget thesimplecart TV. I just want to filter by the value within a TV. The problem I have is that this only works in there is only one value in the TV - ie:
        product code:
        11111

        if the TV has two values:
        11111,22222

        It outputs nothing.

        So I need to somehow tell getresources to output a list of resources which contain ANY of the comma seperated values - this is what i have:

        &tvFilters=`importProductCode==[[*groupedProducts]]`


        is there a way to do this?

        I think this is simpler than my original question!

        Thanks
        Andy


          • 4172
          • 5,888 Posts
          A better way for filtering stuff like that, is to use tagger.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 51020
            • 670 Posts
            Quote from: Bruno17 at Jun 24, 2016, 07:25 AM
            A better way for filtering stuff like that, is to use tagger.

            Ah Ok - I will take a look thanks. I assume I could use:

            &tags=`Books,Vehicles`

            but replace it with:

            &tags=`[[*myTV]]`
              • 51020
              • 670 Posts
              I have tried to work out how to use Tagger for this, but I have got into a right mess!

              So, I have a TV which contains tags using tagger:
              1111,2222,3333,4444

              Then, in my resource, i want to pull in a list of related products.
              Each product is already a resource with a product code of e.g. 1111

              So the previous resource is saying that if the tags match a product code, then pull in those resources.


                • 4172
                • 5,888 Posts
                my call to get related articles to the current article looks like that
                [[pdoResources? 
                &parents=`0`
                &tplWrapper = `crosslinks_wrapper`
                &includeContent=`1`
                &tpl=`crosslink_tpl_text`
                &where=`[[TaggerGetRelatedWhere? &groups=`1`]]`
                ]]


                I'm using pdoResources, but getResources should work the same way.

                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 51020
                  • 670 Posts
                  Quote from: Bruno17 at Jun 24, 2016, 09:25 AM
                  my call to get related articles to the current article looks like that
                  [[pdoResources? 
                  &parents=`0`
                  &tplWrapper = `crosslinks_wrapper`
                  &includeContent=`1`
                  &tpl=`crosslink_tpl_text`
                  &where=`[[TaggerGetRelatedWhere? &groups=`1`]]`
                  ]]


                  I'm using pdoResources, but getResources should work the same way.


                  Thanks for your time Bruno.
                  But I can't see how this will work for my scenario.

                  The tags I have in my resource are product codes of OTHER resources.
                  So the product page I'm in has a productcode of 0000, and has tags to refer to other resouces: 1111,2222,3333

                  Then 3 resources with a TV of productcode with the values of:
                  resource1: productcode:1111
                  resource2: productcode:2222
                  resource3: productcode:3333

                  So I need getresources to read my tags (which there will be several per resource, comma separated) and then cross reference those with a TV called productcode within all other resources.

                  Does that make sense?

                  Thanks
                  Andy
                    • 4172
                    • 5,888 Posts
                    Didn't you say, you have your tags now changed to tagger instaed of the TV?
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 51020
                      • 670 Posts
                      Quote from: Bruno17 at Jun 24, 2016, 10:09 AM
                      Didn't you say, you have your tags now changed to tagger instaed of the TV?

                      Bruno - I am using Tagger in the product to refer to the productcode of the related products.
                      So i have tags (using tagger) of 1111,2222,3333.
                      The productcode is a TV - which is a unique value in each product.

                      So in productcode 0000, i have tags of 1111,2222,3333 - to call in all products with a TV productcode of 1111,2222 and 3333 respectively.

                      Sorry if I'm not explaining myself properly.


                      Andy