Announcement

Collapse
No announcement yet.

Does Product have Duplicates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Does Product have Duplicates

    Is there a condition to test if a product has a duplicate?

    I can test if it is an original, if it is a duplicate and if so what iteration it is .. but unable to see anything which tests if a product has a duplicate or not.


    Bikster
    SellerDeck Designs and Responsive Themes

    #2
    Jont,
    Im sure given Gabe and Norman's collaboration here
    http://community.actinic.com/showthread.php?t=32892


    there is probably a way to create just a condition.

    Probably with some SQL query like

    Code:
    $query = "SELECT [Product Reference] FROM [product] WHERE [Product Reference] LIKE '%!".$prodrefs."'";
    and if you get a return i.e. result count greater than 0, then there are duplicates for this product.
    Thats the theory....
    Fergus Weir - teclan ltd
    Ecommerce Digital Marketing

    SellerDeck Responsive Web Design

    SellerDeck Hosting
    SellerDeck Digital Marketing

    Comment


      #3
      A test such as this will test for duplicate:
      <actinic:variable name="DuplicateIndex" /> > 0

      DuplicateIndex contains the iteration mumber.

      Zoltans posts in this thread may also be helpful:
      http://community.actinic.com/showthread.php?t=30805

      Comment


        #4
        Originally posted by drounding
        <actinic:variable name="DuplicateIndex" /> > 0
        DOH! Of course it bloody will cheers Duncan

        *note to self not to post after midnight*


        Bikster
        SellerDeck Designs and Responsive Themes

        Comment


          #5
          Nice one Duncan.
          This checks IF THIS product is a duplicate.
          i.e. it returns -1 for main product and 1,2,3 etc for the index of duplicate.

          It might also be handy to know IF THIS product HAS a duplicate as well. That was the inference I took from your first post Jont hence the use of some sideways PHP
          Fergus Weir - teclan ltd
          Ecommerce Digital Marketing

          SellerDeck Responsive Web Design

          SellerDeck Hosting
          SellerDeck Digital Marketing

          Comment


            #6
            Originally posted by fergusw
            It might also be handy to know IF THIS product HAS a duplicate as well. That was the inference I took from your first post Jont hence the use of some sideways PHP
            Aye - I have just tried this and indeed it only works when the product is a duplicate - not if it has a duplicate - may need to dig out the PHP book and see what can be done.


            Bikster
            SellerDeck Designs and Responsive Themes

            Comment


              #7
              Jont,
              I've thrown together some PHP that does that over here
              Needs testing.
              Fergus Weir - teclan ltd
              Ecommerce Digital Marketing

              SellerDeck Responsive Web Design

              SellerDeck Hosting
              SellerDeck Digital Marketing

              Comment


                #8
                as a feature i was allready working on, i thought i'd show this screenshot here.

                this feature should be in actinic too.
                Attached Files

                Comment


                  #9
                  Originally posted by gabrielcrowe
                  this feature should be in actinic too.
                  Now......see...... that makes perfect sense.
                  Fergus Weir - teclan ltd
                  Ecommerce Digital Marketing

                  SellerDeck Responsive Web Design

                  SellerDeck Hosting
                  SellerDeck Digital Marketing

                  Comment


                    #10
                    Cheers Fergus. Was hoping for a nice simple PHP solution but not sure that is going to be possible.


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      Jont,
                      I have managed to get the PHP script I wrote returning a yes/no for duplicates, a number value for the number of duplicates and I am now looking at building an HTML list of duplicates linking to page where duplicate resides.
                      Not sure why anyone might need that functionality, but it works!

                      What exactly do you require it to do?
                      Fergus Weir - teclan ltd
                      Ecommerce Digital Marketing

                      SellerDeck Responsive Web Design

                      SellerDeck Hosting
                      SellerDeck Digital Marketing

                      Comment


                        #12
                        Hi Fergus,

                        first to admit PHP is relatively new to me so I only dabble in the shallows.

                        What I am hoping to do is only show a piece of code... this is only ever on a master product (never on a duplicate) and ONLY if the master product has no duplicates.

                        I can prevent it showing on the duplicate (using the inbuilt conditions available) but struggling to prevent it showing if a duplicate exists.


                        Bikster
                        SellerDeck Designs and Responsive Themes

                        Comment


                          #13
                          fergus' code does this. i think, or somethiing very similar.

                          it eturns yes, if the pwroduct has dupes. well, surely, then what you're looking for the disply you're data, is a no, then.

                          actually ferg, i'd change that code to a true/false.

                          then it is more php friendly., since you can:

                          PHP Code:
                          if(FergsCondition($passed)) {take($thisaction);} else {take($theotheraction);} 

                          Comment


                            #14
                            Originally posted by jont

                            What I am hoping to do is only show a piece of code... this is only ever on a master product (never on a duplicate) and ONLY if the master product has no duplicates.
                            The example I gave simply returns yes/no (or the no. of duplicates).

                            Depending on what "piece of code" you require to return it should be pretty straight forward to amend this to return "anything" instead of a "yes" and nothing instead of a "no".
                            It could pretty much return watever your require especially if more parameters are used.
                            If you let me know the "piece of code" you want I could throw an example together for you.....
                            Fergus Weir - teclan ltd
                            Ecommerce Digital Marketing

                            SellerDeck Responsive Web Design

                            SellerDeck Hosting
                            SellerDeck Digital Marketing

                            Comment


                              #15
                              Thanks guys... so I could edit

                              $blreturn = 'yes';

                              and replace 'yes' with a Layout containing the HTML. Will any special characters in the HTML layout ( < " / etc ) kill the PHP?


                              Bikster
                              SellerDeck Designs and Responsive Themes

                              Comment

                              Working...
                              X