Announcement

Collapse
No announcement yet.

Show lowest price from products in further sections

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

    #16
    Lee. You're spot on in what it does. You could add a bit of code that sets a $maxprice = 0 and in every loop sets the $maxprice if the $ppraw is greater then the current value. Then you'd be able to output a Prices from £12 to £34 type message.

    Note there is a quirk with Duplicates. If you use ProductPriceRaw with Duplicates, then the duplicates value doesn't get updated when the main product price subsequently gets changed by the shop owner. Something Actinic should really fix as the price is not alterable in duplicates.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #17
      Thanks for clarifying Norman, i'm well impressed with that, a really simple way to do what i'd perceive as a difficult task. Top man.

      Comment


        #18
        Ace thanks Norman.
        I was only a bit wrong......but enough to break it!

        I like the idea of from and to as well, that could be very useful.

        Alex
        Blog, Twitter, Facebook
        Actinic Ecommerce, CMS and Video production

        www.petraboase.com
        www.progrow.co.uk
        www.christopherpiperwines.co.uk
        www.cheeksandcherries.co.uk
        www.skatewarehouse.co.uk

        Comment


          #19
          Here it is with 4 levels and a From and To price.
          Code:
          <actinic:block php="true">$toprice=0;$fromprice=9999999;</actinic:block>
          
          <actinic:block type="ChildSectionList">
          	<actinic:block type="ProductList" >
          		<actinic:block php="true" >
          			$ppraw = <actinic:variable name="ProductPriceRaw" />;
          			if ( ($ppraw != 0) && ($ppraw < $fromprice) ) $fromprice = $ppraw;
          			if ( $ppraw > $toprice ) $toprice = $ppraw;
          		</actinic:block>
          	</actinic:block>
          	<actinic:block type="ChildSectionList">
          		<actinic:block type="ProductList" >
          			<actinic:block php="true" >
          				$ppraw = <actinic:variable name="ProductPriceRaw" />;
          				if ( ($ppraw != 0) && ($ppraw < $fromprice) ) $fromprice = $ppraw;
          				if ( $ppraw > $toprice ) $toprice = $ppraw;
          			</actinic:block>
          		</actinic:block>
          		<actinic:block type="ChildSectionList">
          			<actinic:block type="ProductList" >
          				<actinic:block php="true" >
          					$ppraw = <actinic:variable name="ProductPriceRaw" />;
          					if ( ($ppraw != 0) && ($ppraw < $fromprice) ) $fromprice = $ppraw;
          					if ( $ppraw > $toprice ) $toprice = $ppraw;
          				</actinic:block>
          				<actinic:block type="ChildSectionList">
          					<actinic:block type="ProductList" >
          						<actinic:block php="true" >
          							$ppraw = <actinic:variable name="ProductPriceRaw" />;
          							if ( ($ppraw != 0) && ($ppraw < $fromprice) ) $fromprice = $ppraw;
          							if ( $ppraw > $toprice ) $toprice = $ppraw;
          						</actinic:block>
          					</actinic:block>
          				</actinic:block>
          			</actinic:block>
          		</actinic:block>
          	</actinic:block>
          </actinic:block>
          
          <actinic:block php="true">
          	if ( $fromprice < 9999999 ) echo 'From £' . number_format($fromprice, 2);
          	if ( $toprice > 0 ) echo ' to £' . number_format($toprice, 2);
          </actinic:block>
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #20
            Has anyone any idea why Norman's fab bit of code above is not showing the product price (using single product per secton) at the end of the trail?

            It work really well but when you get to the actual products they don't have a price until you see the actual product. Looks weird when you have products and sections mixed.

            Alex
            Blog, Twitter, Facebook
            Actinic Ecommerce, CMS and Video production

            www.petraboase.com
            www.progrow.co.uk
            www.christopherpiperwines.co.uk
            www.cheeksandcherries.co.uk
            www.skatewarehouse.co.uk

            Comment


              #21
              prices emtered are ex vat

              Hiya,

              The site I'm working on has the products entered without the VAT, but we need to show the "from price" as above but with the VAT added.

              Would it be easier to catch the product reference associated with the lowest price and then call the product price inc VAT or to calculate the vat in the php itself and just add it to the variable just before it's shown?

              Either way I'm not too sure of how to code this, any ideas?

              Thanks.

              Comment


                #22
                The PHP uses ProductPriceRaw which is VAT exclusive. I'd just multiply it by 1.2 if all your products are VAT inclusive.

                E.g.
                Code:
                <actinic:block php="true">
                	$fromprice *= 1.2;
                	$toprice *= 1.2;
                	if ( $fromprice < 9999999 ) echo 'From £' . number_format($fromprice, 2);
                	if ( $toprice > 0 ) echo ' to £' . number_format($toprice, 2);
                </actinic:block>
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #23
                  I am trying to implement this on a site that uses a single product per page. Ideally I would only like to show the from price for the penultimate section (i.e the one that contains products but as sections) other sections should not show anything, as 'from' prices at this level will be meaningless.

                  Does anyone have any ideas on how I might be able to change the above code to achieve this, pretty please
                  christopherpiperwines.co.uk
                  skatewarehouse.co.uk
                  progrow.co.uk
                  cheeksandcherries.co.uk

                  Comment


                    #24
                    If the code is within a Block on product price it only shows at levels where a product is at next level down. The code in the AUG is along the lines of the section link layout code i use (good starting point), but it's not exclusive to the level, it's a global layout ie you have one layout for all levels and the price only shows at the appropriate level when there is one. Try it in there would be my first test.

                    Comment


                      #25
                      Thank you I have the code working so it shows the prices for the one level with products in but im getting an error:

                      Error in condition (A PHP error has been found on the page ('Parse error: parse error in main on line 1'). The error is coming from the 'Product Price Including Tax' layout. Click here to go to the code.) (10 places)

                      &

                      Error in condition (A PHP error has been found on the page ('Parse error: parse error in main on line 1'). The error is coming from the 'Act Section Line' layout. Click here to go to the code.) (10 places)

                      Please can you someone let me know where I have gone wrong?

                      Many thanks
                      christopherpiperwines.co.uk
                      skatewarehouse.co.uk
                      progrow.co.uk
                      cheeksandcherries.co.uk

                      Comment


                        #26
                        Start with the complete AUG code and adjust that, it definitely works as I've used it for many years now, you might have a copy paste issue.

                        Comment


                          #27
                          This is a great bit of code, Thank you Norman, something I have been looking for / working on for a while.

                          But (isn't there always a but)

                          I have it working fine in all sections except the final one, where I really want it. Using single product per page (creating a section for each page) and it does not show the price in that final section page.

                          Have played around with the blocks but can not seem to get it operating. It is fine in the sections above this so code must be largely correct.

                          Also

                          I have searched the AUG for this solution per leehacks reference and can not find the reference - what is it titled in the index - from what I can see it may refer to what I want as it seems to be exactly what Angi needed.

                          Great post - thanks everyone.
                          David Cunningham

                          www.truska.com
                          -----------------------------
                          ECommerce (SellerDeck) & Web Design, Hosting, Search Engine Optimisation, Social Media and Remote Backup (Truska Backup)

                          Comment

                          Working...
                          X