Announcement

Collapse
No announcement yet.

Product Layout

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

    Product Layout

    I want to have some of my product layouts as follows:

    Product Description Part 1 (general blurb about product)
    Choices
    Quantity
    Add to Basket
    Product Description Part 2 (sizing, colours, instructions etc

    The only way I can think of doing this is having Product Description Part 2 as Custom Variables, but is there any other way of spliting out where certain parts of the product description?

    Kathy
    Kathy Newman

    #2
    Use fragments for part 2 is your easiest solution.

    Comment


      #3
      The not so simple solution would be to write a bit of php to test the product description and display say the first part or second part based on a phrase within the decription.

      Comment


        #4
        Thanks both - the fragment route would be ok but if possible would much rather keep all the information within the product description - makes much easier when duplicating products in other sections.

        PHP does sound the way to go.

        Kathy
        Kathy Newman

        Comment


          #5
          This can be done by tweaking Tabber (which Kathy has).

          Replacing the Tabs with a set of HR separated items:

          Make sure you have Tabber (at least V2.04) installed.

          Go to Design / Library / Layouts / TabbedDescriptions
          Right-click "TabbedProductTabs" and choose Copy.
          Rename that copy to be "HR Separated".
          Into "HR Separated" paste the following:
          Code:
          <actinic:block php="true">
          // HR Separated Product Description V2.04
          $desc = <<<TBPRDSC
          <actinic:variable name="ProductDescription" selectable="false" />
          TBPRDSC;
          if ( preg_match('/(.*?)({.+?}.*$)/', $desc, $bits) )	// is there at least one tab?
          	{
          	$panecount = 0;
          	$havepanes = true;
          	$tabhtml = '<div class="tab-panes">';
          	$tabcode = $bits[2];
          	if ( preg_match('/(.*?){}(.*$)/', $tabcode, $bits) )	// optional {} signifies end of tabbed text
          		{
          		$tabcode = $bits[1];
          		}
          	while ( preg_match('/{(.*?)}(.*$)/', $tabcode, $bits) )
          		{
          		$tabname = $bits[1];
          		$tabtext = $bits[2];
          		$tabcode = '';
          		if (  preg_match('/(.*?)({.+}.*$)/', $tabtext, $bits) )	// more tabs?
          			{
          			$tabtext = $bits[1];
          			$tabcode = $bits[2];
          			}
          		// output current tab
          		echo '<hr/>';
          		echo '<h2>' . $tabname . '</h2>';
          		echo $tabtext;	
          		}
          	}
          </actinic:block>
          OPERATION


          In your product layout replace ProductDescription with

          Code:
          <actinic:variable name="TabbedDescriptionAdvanced" value="TabbedProductPrefix" />
          
          <actinic:variable name="TabbedDescriptionAdvanced" value="TabbedProductSuffix" />
          
          <actinic:variable name="TabbedDescriptionAdvanced" value="HR Separated" />
          These lines are respectively:
          The text before any {...}
          The text after any optional {}
          The tabbed are now displayed as HR separated items.

          These 3 items do not have to be in the same place on the page layout.



          CUSTOMISATION

          The 3 lines in layout "HR Separated":

          Code:
          		echo '<hr/>';
          		echo '<h2>' . $tabname . '</h2>';
          		echo $tabtext;
          Output the <hr> the title and the body text. Alter as required.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            ooh..I might tinker with that!

            How can I tell what version of the tabber I'm using?
            never mind...found that bit..definitely an old version (1..2 lol)
            Tracey

            Comment


              #7
              Best revisit as I've been making some edits. Will send you the most recent version.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment

              Working...
              X