Announcement

Collapse
No announcement yet.

Remove or Disable Qty Input

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

    Remove or Disable Qty Input

    Hi all,

    Quick Q hopefully.

    Anyone know of a way of removing the ability to amend the quantity in the cart or just disabling it, so that when the view cart element is showing, the customer can not amend it.

    Basically need to force any quantity selections at the product level only, which have achieved, but prevent any changes at the cart view level, which if they need to adjust this, then they will need to remove the product and readd to the cart from the product page.

    Any suggestions gratefully received.

    Martin

    #2
    Edit ActinicOrder.pm (back it up first). Look for the line
    Code:
    <INPUT TYPE=TEXT SIZE=\"4\" NAME=\"Q_" . $nLineCount . "\" VALUE=\"". $sQuantityText . "\" STYLE=\"text-align: right;";
    change it to
    Code:
    <INPUT disabled TYPE=TEXT SIZE=\"4\" NAME=\"Q_" . $nLineCount . "\" VALUE=\"". $sQuantityText . "\" STYLE=\"text-align: right;";
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Hi Norman,

      Thanks for that and had thought about that way, but had hoped that there would be a way of achieving it within a hidden text element or within the templates, so as not to have to keep applying this change every time the core Actinic is upgraded..

      Such is and will go back to the drawing boards on this one..

      Thanks again.

      Comment


        #4
        Unfortunately, that wont work.

        Soon as it is disabled at this level, then the initial view cart is fine, but then upon clicking continue it says that must state a value for the qty, so looks like by disabling it, it shows it within the input, but then is not recognised by the scripts upon update, continue etc etc even with it still showing the original accepted quantity... strange one..

        Comment


          #5
          Threw a readonly=readonly in there instead which has overcome it

          Comment


            #6
            Sorry - I meant readonly but typed disabled. Disabled means that the value isn't submitted. Readonly does get submitted.

            PS don't use readonly=readonly - just readonly is correct
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              The non Perl way would be to add some JavaScript at the end of Act_ShoppingCartXML.html that scans through every product form and element, looks for field names starting "Q_" and sets their readonly attribute. Better to patch the Perl I think.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment

              Working...
              X