Post by lg1 » Sun Aug 15, 2010 1:13 pm

I am new to the opencart community and have found lots of great stuff allready.

I am testing out this software for use for a small clothing company who wishes to go online.

One thing i couldnt find was a good size chart mod or something that you automatically take table data and display it.

So i made one with the help of a jquery script called CSV2TABLE.

I dont have might sight live so i cant show you how it intergrates with OpenCart but i can give you the code i used so that it might help you.

For basic examples i have made a site where you can see it in action and see the potential as you can do graphs also
http://buxwear.com.au/test/test.html HTML example no opnecart integration

I used fancybox also for dramatic affect.

Here is how you do it.

Add the files to header.tpl (catalog/view/theme/default/template/common)

Code: Select all

<script src="catalog/view/javascript/jquery.csv2table-0.02-b-2.8.js" type="text/javascript" charset="utf-8"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
If you want charts

Code: Select all

 
<script src="jquery.jqchart-0.03-beta-1.1.js" type="text/javascript" charset="utf-8"></script>
For fancybox

Code: Select all

 
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.1.pack.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/fancybox/jquery.fancybox-1.3.1.css" media="screen" />

    <script type="text/javascript">
    $(document).ready(function() {
$("a#inline").fancybox({
	titlePosition		:'inside',
	titleFormat		:'formattitle',


});
    });
    </script>
Now what i did was edit the product.tpl (catalog/view/theme/default/template/product) so it dynamically added the size chart based on the product model.

And added a field called sizechart

Code: Select all

  <td><b><?php echo "Size Chart"; ?></b></td>
		
		  <?php $filename = 'download/'. $model . '.csv';
			 if (file_exists($filename)) { ?>
                <td>
		        <script>
	  		       $(function(){
	  	              $('#sizechart').csv2table('<?php print($filename);?>');
			       });
			 </script>
			<a href="#sizechart" id="inline" title="<?php print($heading_title);?> Size Chart" >Click Here</a>
			<div class="hide">
			<div id="sizechart">
			&nbsp;</div></div>
		  </td>
		        <?php } else { ?>
			        <td>Not Available</td>
           	       <?php } ?>


What this should do is look up the folder downloads and look if there is a CSV file matching the model of the product if it is it will display the sizechart is a fancybox with the title being the title of the product.

Please comment, i am not a coder so some of this could be wrong and am new to OpenCart

Image

Get CSV2TABLE Here http://plugins.jquery.com/project/csv2table

Get Fancybox Herehttp://fancybox.net/
Last edited by lg1 on Mon Aug 16, 2010 6:39 am, edited 2 times in total.

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm

Post by Maansy » Sun Aug 15, 2010 3:34 pm

sweet. this could be tweeked to do more stuff. i am thinking maybe you can make it show extra product or services to purchase on the way.
if customer goes 1 product page ([ants as your example show) then he sees a link for shirt in the pants page ( ex: Grab a Shirt on the way) then he click the Grab a Shirt on the way link and a jqry window pops up lick in your eample displaying all the (pre definded in admin page) shirts pruducts.
maybe i am just dreaming up load hehe.

nice add-on by the way, i didnt have to chance to play with it yet

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by lg1 » Sun Aug 15, 2010 5:09 pm

I also made a fancybox login screen

Image

Very easy to do, just edit the header.tpl and have an inline form to popup if not logged in

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm

Post by Maansy » Sun Aug 15, 2010 5:15 pm

looks nice, i bet you can do so many things with that :)
good work LG

ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com


User avatar
Active Member

Posts

Joined
Thu Jun 24, 2010 6:04 am


Post by lg1 » Sun Aug 15, 2010 6:10 pm

Thanks, next step is to change the add to cart button to be a fancybox option chooser as in clothing there is never just one size.

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm

Post by qahar » Sun Aug 15, 2010 11:15 pm

cool stuff.. but i can't see yout example..
it's broken link, can you update it :)

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by lg1 » Mon Aug 16, 2010 6:38 am

Sorry left the l out of html

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm

Post by qahar » Mon Aug 16, 2010 7:36 pm

I expected to see an example like in the picture ;D

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by lg1 » Mon Aug 16, 2010 8:39 pm

You wanted an example of the login script?

http://fancybox.net/blog Look at login

But thats not really wat its about.

I will make another thread tommorow, on fancybox login, showing how to change the text from login to logout and welcome username also

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm

Post by qahar » Tue Aug 17, 2010 12:24 am

i meen example of size chart, i just wanna know is that used to give information or you can choose it as option. :)

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by lg1 » Tue Aug 17, 2010 5:38 am

I did it as an option eg, if so and so is true show fancybox.

So you could have a page called size charts, and just enter the product code in a box and it would find the right one for you.

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm

Post by lg1 » Thu Aug 19, 2010 8:43 am

Here is another things

Might be what you mean qahar

http://buxwear.com.au/test/test2.htm

You can have an option box and select the style you want via the optionbox

http://buxwear.com.au/test/test2.htm

The examples all use php and are done dyanmicly based on the page that you are on, but if you want a single page to display all size charts this might be a more appropriate way to do it

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm

Post by qahar » Thu Aug 19, 2010 9:26 am

thank..

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by JM6891 » Wed Feb 23, 2011 6:50 pm

This is awsome! Thank you for sharing!

New member

Posts

Joined
Fri Dec 10, 2010 7:22 pm

Post by JM6891 » Thu Feb 24, 2011 9:38 pm

Thanks again for sharing this, it's really cool...

I'm having a problem with files that are inserted for downloads in that it is adding an extra extension that then causes the file type and name not to be recognised (which is required for the above instructions to work). i.e:

filename.csv is changed to something like filename.csv.6b64aaa4276304634t28304hg

Is there any way to upload it without the extra extension?

I'm using Opencart version 1.4.9.3

New member

Posts

Joined
Fri Dec 10, 2010 7:22 pm

Post by lg1 » Tue Mar 01, 2011 10:26 am

I wish i could help but have since moved to prestashop

I uploaded it manually, i found no way to upload it through the GUI as i encontered the same problems as you

lg1
New member

Posts

Joined
Sun Aug 15, 2010 12:48 pm
Who is online

Users browsing this forum: No registered users and 2 guests