Post by lair12 » Sat Jun 25, 2011 9:52 am

I am looking to embed an MP3 player in my product highlight page. If I add the block of text starting in line 13 below to my product.tpl file, it does indeed play the player where I want it. But of course, it only plays the one mp3 listed. What language should I add to reference this mp3 with the data input elsewhere on the product entry or other entry page? Each different product needs to play its own different mp3.

I'm new at this and slow at understanding the code options. I know enough to be dangerous with this, but have been please with what I have been able to do so far. Eventually I would like to embed the player on the page with the list of music rather than the detailed description page.

The site is up testing (two products) at http://www.ariosostrings.com/cart

THANKS!


<div class="product-info">
<?php if ($thumb || $images) { ?><div class="left"><?php if ($thumb) { ?>
<div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" /></a></div>
<?php } ?><?php if ($images) { ?><div class="image-additional"><?php foreach ($images as $image) { ?>
<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a> <?php } ?> </div> <?php } ?></div><?php } ?><div class="right"> <div class="description"> <?php if ($manufacturer) { ?><span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br /><?php } ?>

<div><object codebase="http://www.google.com/reader/ui/3523697 ... player.swf" height="27" width="400"><param name="Src" value="http://www.google.com/reader/ui/3523697 ... player.swf" /><param name="Quality" value="High" /><embed flashvars="audioUrl=http://www.ariosostrings.com/cart/catal ... uartet.mp3" height="27" quality="best" src="http://www.google.com/reader/ui/3523697 ... player.swf" type="application/x-shockwave-flash" width="400"></embed></object></p>

</div>

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by inactiveaccount9912 » Sat Jun 25, 2011 11:00 am

Here is an ideea.

Use sku or location field to input the mp3 url . Well take as example sku. Every product has an sku field in admin , so there you insert the link http://www.ariosostrings.com/cart/catal ... uartet.mp3

Then in the tpl , the code would be
<div><object codebase="http://www.google.com/reader/ui/3523697 ... player.swf" height="27" width="400"><param name="Src" value="http://www.google.com/reader/ui/3523697 ... player.swf" /><param name="Quality" value="High" /><embed flashvars="audioUrl=<?php echo $sku; ?>" height="27" quality="best" src="http://www.google.com/reader/ui/3523697 ... player.swf" type="application/x-shockwave-flash" width="400"></embed></object></p>
And for the sku to work that way , you also have to alter the product.php
After line
$this->data['model'] = $product_info['model'];
add line
$this->data['sku'] = $product_info['sku'];
And you should probably make the sku field wider as I see the url is pretty long. By default is 64 but you can easyly change it with phpmyadmin

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by lair12 » Sat Jun 25, 2011 12:00 pm

A bit more help needed, please. I do not find the $this->data['model'] etc. language in my file admin-model-catalog-product.php. I am using version 1.5...is that the reason, or is there another product.php I should find.

Also, phpMyAdmin does not list afield for SKU and I am not sure why. DO I have this turned off somewhere?

Also, which style sheet or file controls the html for the data selection input form so that I can change the text name for the field to Sound File Link? Can I possibly widen the field with this as well?

The flash mp3 player is indeed where I want it, but nothing is linking to it yet.

Thanks!

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by lair12 » Sat Jun 25, 2011 12:05 pm

I did find where to allow a wider field for the SKU in phpMyAdmin. But it still is not wider on the input data form.

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by lair12 » Sat Jun 25, 2011 12:55 pm

I found the code below in the product.php file in admin/controller/catalog. Is this not what you wanted me to make sure I had or to add? I assume it does not need to be repeated.

Here is the error in the web page: <embed flashvars="audioUrl=<b>Notice</b>: Undefined variable: sku in <b>/cart/catalog/view/theme/default/template/product/product.tpl</b> on line <b>30</b>.

Here is what it is not liking (or finds undefined): <embed flashvars="audioUrl=<?php echo $sku; ?>

There seems to be no problem with the sku field in the product file in phpMyAdmin.

}

if (isset($this->request->post['model'])) {
$this->data['model'] = $this->request->post['model'];
} elseif (isset($product_info)) {
$this->data['model'] = $product_info['model'];
} else {
$this->data['model'] = '';
}

if (isset($this->request->post['sku'])) {
$this->data['sku'] = $this->request->post['sku'];
} elseif (isset($product_info)) {
$this->data['sku'] = $product_info['sku'];
} else {
$this->data['sku'] = '';
}

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by inactiveaccount9912 » Sun Jun 26, 2011 2:25 am

You dont have to do anything in admin -model or controller.

The product.php I was reffering is the catalog/controller/product/product.php , There you bring the sku (add that simple line)

Then in catalog/..../product.tpl you add your code for the swf player , and instead of the actual mp3 url , you echo the sku (like I showed in my previous post - the sku code is bolded)

Wider , I meant longer , not necessarly the field in admin to be wider , but the field in the db to accesp more then 64 chars. If you allready done that , ,you are ok.

In admin product form , I understand you want it to be "Mp3 Url" instead of "SKU"

Go to admin>language>english>catalog>product.php , find a line with something like entry_sku , and in the right SKU. Replace that SKU word with the one you want.

All the respect,
Flo.

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by lair12 » Mon Jun 27, 2011 12:56 am

I only seem to be able to have this work using the "model" variable. Every other one (upc, sku, keyword,location) give me the error:

Notice: Undefined variable: keyword in /cart/catalog/view/theme/default/template/product/product.tpl on line 31

I guess I need to learn somehow to "define" these variables somewhere to give me full use of this option. While it is working now, I realize I need to use another existing data to echo above this to say if there is or is not a sound sample.

Thanks for your help so far.

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by lair12 » Mon Jun 27, 2011 1:08 am

YAY! I went to the product.php file and copied the language that I found for "model" three time (sku, ups, location) in two locations and these three now work as defined variables!!!!!!!

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am

Post by inactiveaccount9912 » Mon Jun 27, 2011 2:09 am

In product.php , all you have to do is this

After line
$this->data['model'] = $product_info['model'];

add line

$this->data['sku'] = $product_info['sku'];

Thats all , the sku will work now, so , in the tpl , instead on the actual url, put this <?php echo $sku; ?>

That is all.

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by lair12 » Mon Jun 27, 2011 9:42 am

Yes, that is what I now have done and all works. Now, if I could just figure out how to embed that player in the LIST mode before you click on description.....!

Ideas and location of file for this???

New member

Posts

Joined
Thu Jun 23, 2011 2:13 am
Who is online

Users browsing this forum: Google [Bot] and 5 guests