Announcement

Collapse
No announcement yet.

Set 'MinQuantityOrderable' in the wishlist page 'WishListQuantity'

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

    Set 'MinQuantityOrderable' in the wishlist page 'WishListQuantity'

    If you set a Minimun Quantity Orderable, when you add the item to the wishlist the wishlist page 'Qty Required' and 'Qty Remaining' show the 'Minimun Quantity Orderable' (or a multple of it if you add the product to the wishlist twice or more).

    The 'AddQty' shows '1' and if you add to cart either nothing happens or the layout breaks and a second page appears below the first with the AddQty highlighted!

    The variable that draws the html for the 'WISHLISTQUANTITYADD' is <actinic:variable name="WishListQuantity" />

    Looking at WishList.pl, line 661 the quantity input seems to be defined here.

    Code:
    $VariableTable{$::VARPREFIX . 'WISHLISTQUANTITYADD'} = ACTINIC::GetPhrase(-1, 3091, 1, 32767, 'Q_' . $sProdRef, 1);#"<input type='number' min='0' max='32767' size='4' name='Q_$sProdRef' value='1'/>";
    In 'GetPhrase' - 3091 is the ID in Design Text, 1 is the minum quantity, 32767 is the maximum quantity

    I have tried variously adding the <actinic:variable name="MinQuantityOrderable" /> as well as creating a variable within WishList.pl ( $::g_sMinQty = "<actinic:variable name="MinQuantityOrderable" />" ) and using that but nothing shifts the quantity in WishListQuantity above '1'

    I have also tried using the already defined "$nRemaining" as it is the correct numerical value to no avail.

    I suspect it is my syntax writing in the pl file that is at fault.

    How may I get the 'AddQty' input to show the 'MinQuantityOderable'?

    Click image for larger version  Name:	wlqty.jpg Views:	0 Size:	40.1 KB ID:	553904

    Thank you

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

    #2
    The code fragment:
    Code:
    ACTINIC::GetPhrase(-1, 3091, 1, 32767, 'Q_' . $sProdRef, 1)
    Generates:
    Code:
    <input type='number' min='1' max='32767' size='4' name='Q_<productID>' value='1'/>
    Where the final 1 in the GetPhrase line generates the value, set at a fixed 1.

    You cannot use a product-level Variable in the Perl scripts as they are fixed purpose for all products.
    You'd have to use a passed-in value in place of the final 1.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thank you Norman - Is a 'passed-in value' something I can make?
      Jonathan Chappell
      Website Designer
      SellerDeck Website Designer
      Actinic to SellerDeck upgrades
      Graphicz Limited - www.graphicz.co.uk

      Comment


        #4
        Replacing code fragment:
        Code:
        ACTINIC::GetPhrase(-1, 3091, 1, 32767, 'Q_' . $sProdRef, 1)
        With:
        Code:
        ACTINIC::GetPhrase(-1, 3091, 1, 32767, 'Q_' . $sProdRef, $$pProduct{"MIN_QUANTITY_ORDERABLE"})
        Seems to do what you want.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Pure genius Norman, thank you. I don't really know how to say 'thank you' enough..

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

          Comment


            #6
            You could also replace the min and max hard-coded to 1 and 32767.

            By replacing code fragment:
            Code:
            ACTINIC::GetPhrase(-1, 3091, 1, 32767, 'Q_' . $sProdRef, 1)
            With:
            Code:
            ACTINIC::GetPhrase(-1, 3091, $$pProduct{"MIN_QUANTITY_ORDERABLE"}, ($$pProduct{"MAX_QUANTITY_ORDERABLE"} == 0 ? 32767 : $$pProduct{"MAX_QUANTITY_ORDERABLE"}), 'Q_' . $sProdRef, $$pProduct{"MIN_QUANTITY_ORDERABLE"})
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


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

              Comment

              Working...
              X