Announcement

Collapse
No announcement yet.

mini best seller layout

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

    mini best seller layout

    Can anyone help with the original mini best seller layout code for the homepage (v903) - I have modded mine to take the images from the main product and resize which is fine....

    I also early on removed the code that took some of the text into thr mini best deller so all I have is the image / price and more info link, I want to add back in the code that brought some text over??

    Thanks Ed
    https://www.harrisontelescopes.co.uk/

    Ed Harrison - Menmuir Scotland

    #2
    Does this work?
    Code:
    <p class="text_product_small_info"><actinic:variable name="ProductDescription" /><br>
    Taken this from a fresh site

    If not you might have to pay with the block statements (not blockif)
    "If my answers frighten you then you should cease asking scary questions"

    Comment


      #3
      Thanks but I think it's something like the code below so you can edit the number of words shown??

      Code:
      foreach(explode(" ", $sOriginal) as $sWord)
      
      {
      
      if ($nCount > 12)
      
      {
      https://www.harrisontelescopes.co.uk/

      Ed Harrison - Menmuir Scotland

      Comment


        #4
        Revert it back to factory settings in the design library and then redo the changes you do want to keep. Failing that use the 'compare' facility in the same place, both available on a right click. They always resize the main product image AFAIK, so not sure what you've modded there exactly, i'd expect nothing. The usual mod if any in this area is to get the thumbnail image used instead, so no browser resizing occurs.

        Comment


          #5
          I'm guessing you mean something like this
          Code:
          <actinic:block type="ProductList" >
          <actinic:block php="true" >
          $sShort = "";
          $nCount = 0;
          $sOriginal = '<actinic:variable formatting="style|producttext" encoding="perl" name="ProductDescription" selectable="false" />';
          foreach(explode(" ", $sOriginal) as $sWord)
          {
          if ($nCount > 10)
          {
          $sShort .= "...";
          break;
          }
          $sShort .= $sWord . " ";
          $nCount++;
          }
          echo $sShort;
          </actinic:block>
          </actinic:block>
          But Lee is right, if you are using the best sellers list then what i originally posted would work as it came straight out of a fresh site.
          "If my answers frighten you then you should cease asking scary questions"

          Comment


            #6
            Thanks - cant find where to drop that code in but it does look right - trouble is when I revert it includes ALL the text without the ability to use a word count.

            Basicaly I'm trying to retain the look that Norman's code allows with the original image resized but to include say the first 10 words - I have all the code but cant piece it together!

            I can drop in the original code and get all the text now and the image resized nicely but cant see where to put the word count code in? As I am using the normal short descriptions for lots of text it drags in hundreds of words!

            Thenks Ed
            https://www.harrisontelescopes.co.uk/

            Ed Harrison - Menmuir Scotland

            Comment


              #7
              Heres my working mini best sellers code - which is great as the images are clean without pixelating as they are resized from the original - the code below can be used for mini best sellers or new products and allows you to edit the image size as well as the word count, the image is clickable and the text link is editable. Probably basic stuff to a lot of you but may help those at my level...

              Code:
              <p class="text_product_small_info_heading"><actinic:variable formatting="font(Size|12|Color|9999ff)" encoding="actinic" name="ProductName" /></p>
                 <div class="product_image_cost">
                    <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductImageFileName%22%20%2f%3e%20%21%3d%20%22%22" >
              			<a href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable name="ProductID" />&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e" >&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block>">
              <actinic:block php="true" >
              	// START Create a thumbnail image t_nn_ProductImageFileName - V 1.04
              		$nScaledWidth = 92; 		// scaled image width
              		$sOriginalImageName = str_replace('\\','/', '<actinic:variable encoding="perl" name="ProductImageFileName" selectable="false" />');
              		$sThumbImageName = 'Thumbnails/t_' . $nScaledWidth . '_' . basename($sOriginalImageName);
              		list($width, $height, $imagetype, $imageattr) = getimagesize($sOriginalImageName);
              		switch ($imagetype) 
              			{
              			case 1:
              				$image = @imagecreatefromgif($sOriginalImageName); // Attempt to open GIF
              				break;
              			case 2:
              				$image = @imagecreatefromjpeg($sOriginalImageName); // Attempt to open JPG
              				break;
              			case 3:
              				$image = @imagecreatefrompng($sOriginalImageName); // Attempt to open PNG
              				break;
              			default:
              				$image = NULL;
              			}
              		if (!$image) 
              			{ // tell what failed
              			echo "<br><font color=red>Thumbnail creation error opening: $sOriginalImageName </font>";
              			}
              		else
              			{
              			// Get new dimensions
              			$t_width = $nScaledWidth;
              			$t_height = round($height * ($t_width / $width));
              			// Resample
              			$thumbimage = imagecreatetruecolor($t_width, $t_height);
              			imagecopyresampled($thumbimage, $image, 0, 0, 0, 0, $t_width, $t_height, $width, $height);
              			if ( ! imagejpeg($thumbimage, $sThumbImageName) ) 
              				{
              				echo "<font color=red>Thumbnail creation error saving: $sThumbImageName </font><br>";
              				}
              			else
              				{
              				echo "<img src=\"$sThumbImageName\" width=\"$t_width\" height=\"$t_height\" border=\"0\"";
              				echo ' alt="' . htmlspecialchars('<actinic:variable encoding="perl" name="ProductName" selectable="false" />') . '" />';
              				}	
              			}
               	// END Create a thumbnail image t_nn_ProductImageFileName
               	</actinic:block>
              			</a>
                    </actinic:block>
                 </div>
                 <div>
                    <p class="text_product_small_info_price">
                    <Actinic:PRICES PROD_REF="<actinic:variable name="ProductID" />" RETAIL_PRICE_PROMPT="<actinic:variable name="ProductPriceDescription" />">
                       <actinic:variable name="PriceListRetail" value="Marketing Price List" />
                    </Actinic:PRICES>
                    </p>
               </actinic:block>
              
              <actinic:block php="true" >
              
              $sShort = "";
              
              $nCount = 0;
              
              $sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />';
              
              foreach(explode(" ", $sOriginal) as $sWord)
              
              {
              
              if ($nCount > 12)
              
              {
              
              $sShort .= "...";
              
              break;
              
              }
              
              $sShort .= $sWord . " ";
              
              $nCount++;
              
              }
              
              echo $sShort;
              
              </actinic:block>    
                    <a href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable name="ProductID" />&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e" >&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block>">More info...</a></p>
                 </div>
              Thanks Ed
              https://www.harrisontelescopes.co.uk/

              Ed Harrison - Menmuir Scotland

              Comment


                #8
                Mini best sellers code

                Good evening

                I'm busy trying to get off instantestore and onto Actinic.

                We've had some work done but our designer seems to have gone AWOL so I'm 'muddling through'.

                I stumbled across Ed's code - which, when looking at his site, seems to do exactly what I'm trying to acheive. However, cut and paste to notepad and then into Actinic doesn't give the desired results... Just Thumbnail creation errors when previewing the site.

                Like I said, I'm muddling through so I'll ask, is there something else I should have done?

                Many thanks

                Mart

                Comment


                  #9
                  It may be because the code takes the original image from the product level not extended info level - resizes and uses a creation of a file called thumbnails - do you have your site running Single page per product or SPP?

                  Also are you dropping the code to a V9 site and in the mini best sellers layout??

                  Ed
                  https://www.harrisontelescopes.co.uk/

                  Ed Harrison - Menmuir Scotland

                  Comment


                    #10
                    You need to set up a subfolder called "Thumbnails" and only use .JPG files


                    Bikster
                    SellerDeck Designs and Responsive Themes

                    Comment


                      #11
                      The code worked for me without creating a folder and is fine with gifs and png too...

                      Ed
                      https://www.harrisontelescopes.co.uk/

                      Ed Harrison - Menmuir Scotland

                      Comment


                        #12
                        Mini best seller layout

                        Hmm, not sure how I check re: SPP

                        All I did was cut the code and past it into the Mini Best Seller Layout in the design library :0(

                        Not sure where to go now - my web skills being so limited...

                        BR
                        M

                        Comment


                          #13
                          Screenshots will probably be required of what you have done, so we can see also. Alternatively, contact a designer instead and focus on what you are good at.

                          Comment


                            #14
                            Originally posted by leehack View Post
                            ...or contact a designer and focus on what you are good at.
                            Agreed. However, our success in this area to date has been somewhat limited...

                            Comment


                              #15
                              You could post any work you need completing on www.actlance.co.uk and see what comes back from that.

                              Comment

                              Working...
                              X