Announcement

Collapse
No announcement yet.

Price Layout on Section link so product prices are displayed before clicking through

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

    Price Layout on Section link so product prices are displayed before clicking through

    Hi

    We currently have on our website a function to display a products page on the section link to that producr page.

    See http://www.gamolagolf.co.uk/acatalog/Trolleys.html for an example. The red prices under each product are automatically pulled through from the product page.

    However, my problem is that when i have a page where there are more than one products on it, all the prices are pulled through and the link gets very messy. Also where i have quantity pricing enabled, all the prices again are pulled through.
    What i want is for when there is this problem, to display only the lowest price on the page. I.e. Prices from only £x.xx.

    Is this possible? And if so, how do i go about doing it?

    Thanks for your help in advance.
    Graeme

    #2
    If it were possible to display only the first product's price (which it is) could you order your products so the cheapest is listed first?
    Would this work for you?
    Tracey

    Comment


      #3
      Yes I could make that work. How do i do that though?

      Comment


        #4
        If you use "ListIndex == 1" in your blockif where the price is displayed(or as an additional blockif, depending on how your layout is coded) then it should pull details from only the first product in the section.
        Tracey

        Comment


          #5
          Thanks Tracy. That seems to have stopped the qty prices on the first product coming through, but is still allowing all prices for any other products to appear. Any clues?

          Comment


            #6
            Make sure your blockif says == and not !=

            I can't see why it'd be the wrong way round otherwise
            Tracey

            Comment


              #7
              Hi Tracey,

              I've just gotten round to having another little play with this and still can't get it to work. I've def got it at ==1.

              It does work for the first product in a page, but where there are more than one product per page, it is still pulling through all the prices for the second or even third products (or more). I want to stop this happening and for it to only take the price from the first product.

              Comment


                #8
                You'll have to post the actual code you're using so we can help.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Find attached a screenshot of the code.
                  Attached Files

                  Comment


                    #10
                    Just a thought
                    Try putting your blockif OUTSIDE (ie before) the block (which is presumably your ProductList block) and see if that helps
                    Tracey

                    Comment


                      #11
                      Ah, that's working better now. Only problem is now, where i have a fragment in the first position, the price doesn't pull through.
                      Any way to block out the fragments?

                      Comment


                        #12
                        I'd have to leave that to someone who knows how to split fragments from products because Actinic tends to treat them as one and the same, in the ListIndex.
                        I'm not sure, tbh
                        Tracey

                        Comment


                          #13
                          From memory you use something like product reference is not empty to loose the fragments
                          Unusual Silver Jewellery
                          Giftmill - Unusual Gifts
                          Crystal Healing Jewellery
                          Steampunk Jewellery

                          Comment


                            #14
                            It's quite complex as you have to loop through all products, ignoring Fragments and stopping when you find a proper product. PHP is needed:
                            Code:
                            <actinic:block php="true">
                            	$prc = '';
                            	<actinic:block type="ProductList">
                            		if ( (<actinic:variable name="ProductType" selectable="false" /> != 2) && ($prc == '') )
                            			{
                            			$prc = <<<ENDOFCODE
                            <actinic:variable name="PriceListRetail"/>			
                            ENDOFCODE;
                            			}
                            	</actinic:block>	
                            	echo $prc;
                            </actinic:block>
                            Norman - www.drillpine.biz
                            Edinburgh, U K / Bitez, Turkey

                            Comment


                              #15
                              Here's a more sophisticated one that loops through all the products and if there is more than one price, shows the From and To prices. If only one price found, it only shows that.
                              Code:
                              <actinic:block php="true">
                              	$min = 0;
                              	$max = 0;
                              	<actinic:block type="ProductList">
                              		if ( <actinic:variable name="ProductType" selectable="false" /> != 2 )
                              			{
                              			$prc = <actinic:variable name="ProductPriceRaw"/>;
                              			if ( ($prc < $min) || ($min == 0) ) $min = $prc;
                              			if ( $prc > $max ) $max = $prc;
                              			}
                              	</actinic:block>	
                              	if ( $min != $max )
                              		{
                              		echo sprintf("From £%01.2f to £%01.2f", $min, $max);
                              		}
                              	elseif ( $min != 0 )
                              		{
                              		echo sprintf("£%01.2f", $min);
                              		}
                              </actinic:block>
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X