Announcement

Collapse
No announcement yet.

Limiting content for New Product & Best Sellers

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

    Limiting content for New Product & Best Sellers

    Is it possible to limit the amount of text being displayed in the New Products and Best Sellers listings?

    It looks to me like the body text is taking everything from the "Full Description" field for the product. But I have a lot of products that need fairly lengthy descriptions. So if for example I have three Best Sellers on the Home page, all three will be in the same size box, with some having a lot of empty white space with others having far to much in the description text. I managed a workaround in that the full description is a line or two, then I add a fragment under the product for the full description.

    Is there a more elegant way to achive this?

    Thanks,

    Andrew Baddeley
    Head of Immersive
    NMI Security plc

    #2
    Is that not detailed in the Advanced User Guide?


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      It is I am sure, Zoltan's groovy description shortener or something like that, it shows the first 8 or 10 characters followed by ... if they are to long, looks good.

      Regards,
      Jan Strassen, Mole End Software - Plugins and Reports for Actinic V4 to V11, Sellerdeck V11 to V2018, Sellerdeck Cloud
      Visit our facebook page for the latest news and special offers from Mole End

      Top Quality Integrated label paper for Actinic and Sellerdeck
      A4 Paper with one or two peel off labels, free reports available for our customers
      Product Mash for Sellerdeck
      Link to Google Shopping and other channels, increase sales traffic, prices from £29.95
      Multichannel order processing
      Process Actinic, Sellerdeck, Amazon, Ebay, Playtrade orders with a single program, low cost lite version now available from £19.95

      Comment


        #4
        ah ha! Page 16 of the Advanced User Guide....

        Comment


          #5
          Which user guide?

          Im using version 9 and cant find this fix

          Comment


            #6
            Originally posted by Faulkds View Post
            Which user guide?

            Im using version 9 and cant find this fix
            Try V8.13

            Here is the info:

            Only Displaying the First Ten Words of the Full Description
            It is possible to include a PHP statement which only displays the first 10 words of the full description in the store pages. This is useful if you are displaying a compact version of the product, and don't want the full description to appear.
            Simply click on the product description (in the 'Design' tab) that you want to shorten.
            Then locate the 'ProductDescription' variable in the layout code.
            Highlight that variable and replace it with the following code:
            Code:
            <actinic:block php="true" >
            $sShort = "";
            $nCount = 0;
            $sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />'; 
            foreach(explode(" ", $sOriginal) as $sWord)
            	{
               if ($nCount > 10)
               	{
               	$sShort .= "...";
               	break;
               	}
               $sShort .= $sWord . " ";
               $nCount++;
               }
            echo $sShort;
            </actinic:block>

            Malcolm

            SellerDeck Accredited Partner,
            SellerDeck 2016 Extensions, and
            Custom Packages

            Comment


              #7
              Is it possible to do this with character length instead of word length?

              Searching I can only find posts on word length.
              Regards

              Jason

              Titan Jewellery (Swift Design)
              Zirconium Rings
              Damascus Steel Rings

              Comment


                #8
                Just counting characters is a lot simpler.
                Code:
                <actinic:block php="true" >
                	$sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />';
                	$sShort = substr('<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />', 0, 123);
                	echo $sShort;
                	if ( $sShort != $sOriginal ) echo '...';  
                </actinic:block>
                Replacing the 123 with the number of characters you require.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Many thanks Norman, it worked just as I wanted it to.
                  Regards

                  Jason

                  Titan Jewellery (Swift Design)
                  Zirconium Rings
                  Damascus Steel Rings

                  Comment


                    #10
                    Hi Guys,

                    We are having the same issue with our web site.

                    On our home page we show text below the section photos and for some reason the amount of text stops at different levels, and the text space actually shortens if we try to edit to size.

                    We would like to set the more info button to the bottom of the text box and allow the text to populate to the bottom on the line above the “more info” button.


                    I have found this code within our website, but when I change it. It doesn't seem to change on the website.

                    Can any one help!

                    Link to Website:
                    http://www.livinghouse.co.uk/

                    Cheers,
                    Ian

                    Comment


                      #11
                      Hi Ian,

                      I didn't actually use the code for New products and best sellers as the thread says.

                      I wanted to use it on some pages to auto generate Page Titles and Meta Descriptions so that when generated I could control the length to avoid any Google penalty.

                      My code using Norman's above, would look like this.

                      echo substr('<actinic:variable encoding="perl" name="ProductReference" selectable="false" /> | <actinic:variable encoding="perl" name="ProductName" selectable="false" /> | <actinic:variable encoding="perl" name="JewelleryItem" selectable="false" /> by <actinic:variable encoding="perl" name="brand" selectable="false" /> and made of <actinic:variable encoding="perl" name="Material (Main Material)" selectable="false" /> <actinic:variable encoding="perl" name="Material (2nd Material)" selectable="false" />', 0, 150) . '...';
                      Regards

                      Jason

                      Titan Jewellery (Swift Design)
                      Zirconium Rings
                      Damascus Steel Rings

                      Comment


                        #12
                        This is the code that we currently have on our home page:
                        Code:
                        <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionDescription%22%20%2f%3e%20%21%3d%20%22%22" >
                        						<actinic:block php="true" >
                        							$sShort = "";
                        							$nCount = 0;
                        							$sDesc = '<actinic:variable encoding="perl" name="sProdDescription" selectable="false" />';
                        							if ($sDesc == '') {
                        								$sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />';
                        							}
                        							else {
                        								$sOriginal = $sDesc;
                        							}
                        							$sNoTabs = preg_replace("~({tab\s\").*?(})~msi", "", $sOriginal);
                        							$sNoApos = preg_replace("/[^!.%,a-zA-Z0-9\s]/", "", strip_tags($sNoTabs));
                        							$sNoTags = str_replace("!!<", "", $sNoTabs);
                        							$sNoTags = str_replace(">!!", "", $sNoTags);
                        							foreach(explode(" ", $sNoTags) as $sWord)
                        								{
                        								if ($nCount > 90)
                        									{
                        									$sShort .= "...";
                        									break;
                        									}
                        								$sShort .= $sWord . " ";
                        								$nCount++;
                        								}
                        							echo $sShort;
                        						</actinic:block>
                        					</actinic:block>
                        					<br/><br/>
                        					<a class="ic_link" title="<actinic:variable encoding="perl" name="ProductName" selectable="false" />" href="<actinic:variable name="ProductPageName" />">More Info ></a>
                        			</p>
                        		</div>
                            </div>
                            <div style="clear:both;"></div>
                        </div>

                        Hope can help with solving the issue.

                        Thanks

                        Comment

                        Working...
                        X