Announcement

Collapse
No announcement yet.

MinQuantyOrderable in quantity dialogue

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

    MinQuantyOrderable in quantity dialogue

    Can I put the MinQuantyOrderable variable in the quantity dialogue so it is automatically selected instead of the default zero?

    Thank you.
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    #2
    Works a treat - problem is they all get added to cart!
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    Comment


      #3
      Try this (experimental - best test thoroughly):

      In your product layouts, amend the quantity field to be:
      Code:
      <input type="number" name="Q_<actinic:variable name="ProductID" />" value="<actinic:block if="%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3e%200%29%0d%26%26%0d%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3c%20%3cactinic%3avariable%20name%3d%22MinQuantityOrderable%22%20%2f%3e%29" ><actinic:variable name="MinQuantityOrderable" /></actinic:block><actinic:block if="%21%28%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3e%200%29%0d%26%26%0d%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3c%20%3cactinic%3avariable%20name%3d%22MinQuantityOrderable%22%20%2f%3e%29%29" ><actinic:variable name="DefaultQuantity" /></actinic:block>" data-minqty="<actinic:variable name="MinQuantityOrderable" />" <actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20FALSE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" >onpaste="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />)" onkeyup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />)" onmouseup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />)"</actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22UseDynamicPrices%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e%20%3d%3d%20FALSE" >onpaste="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />')" onkeyup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />')" onmouseup="QuantityChanged(this, '<actinic:variable name="DynamicPriceCGIURL" />', <actinic:variable name="SectionID" />, '<actinic:variable name="ShopID" />')"</actinic:block>/>
      And edit responsive.js and look for the code that increments the quantity button:
      Code:
      				if (elButton.hasClass("inc")) 
      					{
      					nNewVal = nOldVal + 1;
      					} 
      				else 
      					{
      					nNewVal = (nOldVal > 0) ? nOldVal - 1 : 0;	// Don't allow decrementing below zero
      					}
      And replace with:
      Code:
      				var minqty = elInput.attr('data-minqty') - 0;
      				if (elButton.hasClass("inc")) 
      					{
      					nNewVal = nOldVal < minqty ? minqty : nOldVal + 1;
      					} 
      				else 
      					{
      					nNewVal = nOldVal > minqty ? nOldVal - 1 : 0;	// Don't allow decrementing below zero
      					}
      This will use the minimum quantity if it's applied and prevent the [-] / [+] buttons from going below this value.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Thank you Norman. I will try and report back.
        Jonathan Chappell
        Website Designer
        SellerDeck Website Designer
        Actinic to SellerDeck upgrades
        Graphicz Limited - www.graphicz.co.uk

        Comment


          #5
          I cannit find those lines in dynamic.js in Smart or Swift
          Jonathan Chappell
          Website Designer
          SellerDeck Website Designer
          Actinic to SellerDeck upgrades
          Graphicz Limited - www.graphicz.co.uk

          Comment


            #6
            Oops. It's responsive.js that needs editing. I've fixed my post #3 to say this.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Thank you Norman. Best wishes.
              Jonathan Chappell
              Website Designer
              SellerDeck Website Designer
              Actinic to SellerDeck upgrades
              Graphicz Limited - www.graphicz.co.uk

              Comment


                #8
                Hi Norman - This seems to double up the buttons in Swift, I think you just need to replace:

                Code:
                value="<actinic:variable name="DefaultQuantity" />"
                with

                Code:
                value="<actinic:block if="%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3e%200%29%0d%26%26%0d%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3c%20%3cactinic%3avariable%20name%3d%22MinQuantityOrderable%22%20%2f%3e%29" ><actinic:variable name="MinQuantityOrderable" /></actinic:block><actinic:block if="%21%28%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3e%200%29%0d%26%26%0d%28%3cactinic%3avariable%20name%3d%22DefaultQuantity%22%20%2f%3e%20%3c%20%3cactinic%3avariable%20name%3d%22MinQuantityOrderable%22%20%2f%3e%29%29" ><actinic:variable name="DefaultQuantity" /></actinic:block>" data-minqty="<actinic:variable name="MinQuantityOrderable" />"
                For the 'Actinic show for price schedule' bits replace double inverted commas (speech marks) at beginning and end of 'value' and 'data-minqty' expressions with single
                Jonathan Chappell
                Website Designer
                SellerDeck Website Designer
                Actinic to SellerDeck upgrades
                Graphicz Limited - www.graphicz.co.uk

                Comment

                Working...
                X