Announcement

Collapse
No announcement yet.

Can I have the Section Image set by a Product Image?

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

    Can I have the Section Image set by a Product Image?

    I'm working with a Single-Page-Per-Product layout, so I've got each of my products in it's own section, and using the Section Image as the image for the product for the catalog view - as that seems the obvious way to structure it.

    Now, I'm fine with this on the mostpart, obviously it means entering the product name into both the Product and containing Section - but I was wondering, if instead of having to assign the Product image to both the Product and it's SPP Section, is there a way I can set Section Images to default to the image of the Product contained within it?

    Obviously, I know that Sections can contain multiple products, but I thought maybe there would be a way to populate section images using the image of the first product within it.

    I'm doubtful it's possible, and while I know that these things can be filled in via import, it would save me some time if I could do this instead

    #2
    Simply drop

    Code:
                
    <actinic:block type="ProductList" >
                    <actinic:variable value="Standard Product Image"  name="ProductImageLayout" />
    </actinic:block>
    into the section layout.
    This should get you going in the right direction.
    Fergus Weir - teclan ltd
    Ecommerce Digital Marketing

    SellerDeck Responsive Web Design

    SellerDeck Hosting
    SellerDeck Digital Marketing

    Comment


      #3
      Sorry, what does that code do? I've been using Actinic for a while but I wouldn't consider myself an expert.

      Comment


        #4
        It simply looks through all the products within the current section and spits out the product image layout.
        It was merely a pointer to show you a method of getting close to what you want/ You will want to play about with this or amend as required for your own requirements.
        Fergus Weir - teclan ltd
        Ecommerce Digital Marketing

        SellerDeck Responsive Web Design

        SellerDeck Hosting
        SellerDeck Digital Marketing

        Comment


          #5
          Aha, that's exactly what I was after. I just replaced the part of the Section Layout that finds the Section Image and replaced it with that, and it does the job brilliantly.

          Any idea if theres a similar way that will allow me to take the product price value in the same way?

          Comment


            #6
            at its simplest, you want a productlist as fergus has illustrated below, but with a pricelist block inside it, and the price variables you need within that.

            I wrote a more complex layout the other day that cycles through all the prices within the section and outputs the cheapest in the form "FROM: £1.20" or whatever. In this case, some sections had one product, some more than one.

            something like:

            Code:
            <actinic:block php="true" >
            $cheapest=-1; 
            $count=0; 
            $pricemessage="";
            
            
            <actinic:block type="ProductList" >
            
            	$prprice = 0;
            	<actinic:block type="PriceList" />
            		<actinic:block if="%3cactinic%3avariable%20name%3d%22ListIndex%22%20%2f%3e%20%3d%3d%201" >
            			$prprice = preg_replace('/[^0-9]/','','<actinic:variable name="TaxExclusivePrice" encoding="perl" selectable="false" />');
            			$prprice = $prprice / pow(10, <actinic:variable name="CurrencyDigits" />);
            		</actinic:block>
            	</actinic:block>
            
            if ($cheapest > $prprice && $prprice > 0 || $cheapest==-1) 
            	{
            	$cheapest=$prprice; $count++;
            	}
            	else
            	{$count++;}
            	
            </actinic:block>	
            
            if ($count > 0)
            	{
            	$pricemessage .= "<p style=\"text-align: left;\">";
            	
            if ($count > 1) 
            	{
            	if ($cheapest > 0) { $pricemessage.="<span class=\"from\">FROM: </span>"; }
            	}
            
            if ($cheapest > 0)
            	{
            	$pricemessage .= "£".number_format($cheapest,2);
            	}
            	$pricemessage .= "</p>";
            echo($pricemessage);
            	}
            
            </Actinic:block>
            Thanks to Norman for the $prprice stuff in there that replicates the productpriceraw variable (because that one is buggy when it comes to product duplicates).

            Comment


              #7
              here's the link with the problem and the fix.

              http://community.actinic.com/showthread.php?p=306621

              Comment


                #8
                As I simply want to show the price for the only product within each section, I'm trying to replicate the same code as the image, only using the PriceList block instead.

                However, I can't seem to find a variable that will display the price - Product Price Including Tax, or any equivalent. There are a few variables such as PriceLayout, but none of them seem to output the value I'm after.

                Is there a variable that should work, or is there more to it than I realise?

                Thanks for your patience, I really do appreciate the help!

                Comment


                  #9
                  Did you try searching? Searching for "price in section" will work.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    Ah I found what I needed! The code I needed was this:

                    Code:
                    <actinic:block type="ProductList" >
                    <actinic:block type="PriceList" >
                    <actinic:variable name="PriceLayout" />
                    </actinic:block> 
                    </actinic:block>
                    I was almost there, just needed the PriceList block within the ProductList where it could find the value I was after.

                    Thank you, I should be fine now

                    Comment


                      #11
                      So, just like I said

                      Originally posted by IanSaunders View Post
                      at its simplest, you want a productlist as fergus has illustrated below, but with a pricelist block inside it...

                      Comment

                      Working...
                      X