Post by toad78 » Tue Aug 26, 2014 3:01 am

I'm new to creating vqmod files and was recommended to create an .xml to override the default display of the featured module. I want to add the product description in the featured module. The only method I figured out how to do was to modify the core file (I know, I shouldn't do that), but I would like to learn more about creating the vqmod file.

So I want to add this:

Code: Select all

'description' => substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
into the featured.php file under this array:

Code: Select all

$this->data['products'][] = array(
And then have this code:

Code: Select all

<p class="fldesc"><?php echo $product['description']; ?></p>
within the featured.tpl file before the rating code:

Code: Select all

<?php if ($product['rating']) { ?>
Trying to understand creating .xml file is a bit blurry for me, and I've only been able to get this far:

Code: Select all

	<file name="catalog/controller/module/featured.php">
		<operation>
			<search position="before" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
			<add><![CDATA[$prod_desc = $product_info['description'];]]></add>
		</operation>
		<operation>
			<search position="after" offset="6" error="skip"><![CDATA[$this->data['products'][] = array(]]></search>
			<add><![CDATA['description'       => $prod_desc,
'description'       => $prod_desc]]></add>
		</operation>
	</file>
	
		<file name="catalog/view/theme/courtscandies/template/module/featured.tpl">
		<operation>
			<search position="replace" error="skip"><![CDATA[<?php if ($product['rating']) { ?>]></search>
			<add><![CDATA[<?php "<p class=\"fldesc\"> . $product['description'] . "</p>"; ?>]</p></add>
		</operation>
Can someone verify this code for me and let me know if I'm missing anything?

Thank you.

New member

Posts

Joined
Sun Dec 08, 2013 8:30 am
Who is online

Users browsing this forum: No registered users and 4 guests