Announcement

Collapse
No announcement yet.

Push buttons showing prices

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

    Push buttons showing prices

    Any ideas please

    My products come in standard widths which are then available in 4 different finishes and up to 6 different lenghts - each of these variables has a different selling price.

    I would like to display the choice of prices all together but a drop down list becomes too long - 12 or more options.

    I can display them on a push button table but the buttons are 'add to cart' can I change this to the price for each variant?

    Or any other thoughts.......thanks:

    #2
    Here is a ReadMe on doing just that.

    Code:
    ############################################################################################
    
    How to make an Actinic V6 selection button matrix for a list of colours and sizes, all with
    different prices, display the appropriate price on each button.
    
    This example is for a product with exactly two attributes - like Colour and Size - it will need modified if
    you have more attributes or components.
    
    
    The following is for a product with exactly two attribute (like Colour and Size).
    
    ############################################################################################
    
    Make a copy of Act_ProductLine.html and call it (say) Table_ProductLine.html
    
    Edit Table_ProductLine.html and replace the line:-
    
    			<Actinic:ACTIONS>NETQUOTEVAR:ADDTOCARTBUTTON</Actinic:ACTIONS>
    
    with the following code:-
    
    
    <Actinic:ACTIONS><!-- NETQUOTEVAR:ADDTOCARTBUTTON -->
    <script language=JavaScript>
    var ref = 'NETQUOTEVAR:PRODUCTREFERENCE';
    var addtocart = ' - Add';
    var rows = sizes.length;
    var cols = colours.length / (rows + 1);
    document.write('<input type=hidden name="v_' + ref + '_3" value="on"><table><tr align=center><td></td>');
    for ( var i = 0; i < cols; i++ )
      {
      document.write('<td>' + colours[(rows + 1) * i] + '</td>');
      }
    for ( var j = 0; j < rows; j++ )
      {
      document.write('<tr><td>' + sizes[j] + '</td>');
      for ( i = 0; i < cols; i++ )
        {
        document.write('<td><input type=submit name="vb_' + ref + '_1_' + (i + 1) + '_2_' + (j + 1) + 
                       '" value="£' + colours[(i * (rows + 1)) + j + 1] + addtocart + '"></td>');
        }
      document.write('</tr>');
      }
    document.write('</table>');
    </script></Actinic:ACTIONS>
    
    
    ############################################################################################
    
    You may want to change the line "var addtocart = ' - Add';" above to suit your needs.
    
    Now create your product with zero price.
    Select Table_ProductLine.html as the Product Layout.
    Give it a single component called (e.g.) Info.
    Give this component an Attribute called (e.g.) Colour.
    Give that Attribute choices for each colour (e.g. Red, Green, Blue).
    Give this component another Attribute called (e.g.) Size.
    Give that Attribute choices for each size (e.g. Small, Large).
    
    Now double click the component, choose Permutations, Fill List, and fill in the corresponding prices for each combination.
    OK out, double click the product and you'll now have a Components tab.
    Under Components, select Sum of Component Prices.
    
    Finally put the following code into the Full Description box (under all your own text):-
    
    !!<<script language=JavaScript>
    var sizes =   ['Small','Large'];
    var colours = ['Red','1.00','2.00','Green','3.00','4.00','Blue','5.00','6.00'];
    </script>>!!
    
    You have to alter the colour, size and price descriptions to match your product.  
    Only change the bits within the square brackets.  All entries need 'quotes' as shown.
    The prices are pounds and should follow the sequence:-
    	 Colour1, Price for Size1, Price for Size2, Colour2, Price for Size1, Price for Size2, etc.
    You can have any number of colours and sizes and the button matrix will be automatically built to suit.

    Norman
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thanks Norman - just the job

      Comment


        #4
        ps - Java script goes above description

        Comment


          #5
          I can get a price matrix but it seems only for 1 product per section. Is it possible to get more?

          Thanks

          Comment


            #6
            Are you remembering to use Table_ProductLine.html as the Product Layout for all these products?

            Also if you make an error in the bit of JavScript that goes into the Product description then the details from the previous product may be displayed.

            Best test with Netscape 7 and go to Netscapes Tools / Web Development and turn on JavaScript Console. You get MUCH better error messages from Netscape.

            Do you have an URL so I can see?

            Norman.

            PS - Just tested it with 2 products and it worked OK.
            Also this Readme was done ages ago. There may be better ways of doing this. If I find some time I'll revisit this.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Thanks for your help Norman - afraid I'm still struggling with this though

              I can create one price matrix fine - if I copy and paste in the same section only the first one (in order) works - if I copy and past into a new section then it works ok as does the original?

              Also is there any way to include ' to denote feet in the java description for lengths?

              Can't give you an URL as the site isn't live

              Nigel

              Comment


                #8
                Are you getting JavaScript errors. In Internet Explorewr do View and make sure "Status Bar" is checked. Now load your page and look for an error symbol in the bottom left of screen.

                However, as I mentioned above,it is much better to use Netscape for testing JavaScript related code.

                Norman
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Norman - getting closer I hope

                  When the products with tables display as 'image left of text' they work. When displayed as 'image right of text' the table displays as a push button.
                  These products with tables always want to display in this alternating way - even when the section product layout default is set to 'image right of text'. The product layout tab is used by the changed html.
                  Is there a way to have layout 'image right of text' for these products?
                  Thanks in advance
                  Nigel

                  Comment


                    #10
                    There are two possibilities here:

                    1) The wrong template has been explicitly selected within the 'Product Layout' field in the 'General' tab of the products

                    2) The product layout template itself has got two sets of product code within it - one with the image to the left (and the correct code for the buttons) and one with the image to the right (with the incorrect code for the buttons).

                    Check 1) by looking at the 'Product Layout' field for the products within the section. Set all these to 'Use Parent' (ensuring that the correct Product Layout template is set in the 'Product' tab of the section that contains the products).

                    Check 2) by looking at the code of the template. Search for NETQUOTEVAR:NEXT - does it appear once or twice? If twice then delete all the code underneath the first instance of NETQUOTEVAR:NEXT. Then save the template and preview.

                    Actually, to be on the safe side it would be better to cut and paste the code somewhere safe just in case you remove the wrong code.

                    Comment


                      #11
                      Chris
                      The product layout tab within the general tab of the product is set to the changed Act_ProductLine.html as per Norman's initial reply (saved with a new name)
                      There are 2 entries of NETQUOTEVAR:NEXT within this changed code
                      1 followed by < !--Next product in the template starts here -->
                      and the other at the bottom of the code < !--Insert for the bottom of the individual product -->

                      For your info - I can set a product to display the price table - copy and paste it say 4 times - the 4 products will layout alternating image to left/image to right - only those layed out image to left will display the price table. Those displayed image to right display as radio buttons.
                      Nigel

                      Comment


                        #12
                        If you are using a layout that alternates product images left / right then there will be two occurrences of

                        <Actinic:ACTIONS>NETQUOTEVAR:ADDTOCARTBUTTON</Actinic:ACTIONS>

                        Replace both of them with the patched code as per above.

                        Norman
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #13
                          Thank you Norman - that's done it

                          Comment


                            #14
                            Price matrix in version 7

                            Me again Norman - the push button price matrix doesn't want to work with version 7 - can you help? - Thanks

                            Comment


                              #15
                              It took you over 3 weeks and a colossal number of posts to get it right for V6. Are you sure you're not just repeating earlier mistakes. Without any other info as to what's happening I can't really help.

                              Norman

                              PS It works just fine for me.
                              Last edited by NormanRouxel; 23-Jul-2004, 07:23 AM. Reason: Updating after sucessful test
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X