Post by victor.gatto » Tue Oct 11, 2011 11:50 am

Hi i sorta created harryos version of ajax add to cart but in vqmod instead.

SORRY HARRYO IM IMPATIENT :P

Me being a n00b, i knew this wouldnt work, did i do something wrong?


Code: Select all

<modification>
	<id>Ajax Add to Cart Notification</id>
	<version>1.5.1.x</version>
	<vqmver>1.2.3</vqmver>
	<author>harryo w/ collab of victor.gatto</author>
	<file name="catalog/view/theme/default/template/product/product.tpl">
		<operation>
			<search position="after"><![CDATA[if (json['error']) {
				if (json['error']['warning']) {
					$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
				
					$('.warning').fadeIn('slow');
				}
				
				for (i in json['error']) {
					$('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>');
				}
			}	 ]]></search>
			<add><![CDATA[		/*Begin added by Harryo*/
			if (json['success']) {
				$('#cart-success').after('<div class="success" style="display: none;">' + json['success'] + '</div>');
				
				$('.success').fadeIn(1000).delay(2000).fadeOut(1500);

				$('#cart_total').html(json['total']);
/*End added*/]]></add>
		</operation>
	</file>
	<file name="catalog/view/theme/default/template/common/header.tpl">
		<operation>
			<search position="after"><![CDATA[<div id="container">]]></search>
			<add><![CDATA[<!--/*Begin added by Harryo*/--><div id="cart-success"></div><!--End code added-->]]></add>
		</operation>
	</file>
	<file name="catalog/view/theme/default/stylesheet/stylesheet.css">
		<operation>
			<search position="after"><![CDATA[.breadcrumb {
	color: #CCCCCC;
	margin-bottom: 10px;
}]]></search>
			<add><![CDATA[        /*Begin added by Harryo*/
.success, .warning, .attention, .information, .rev-success {
	padding: 10px 10px 10px 10px;
	margin-bottom: 5px;
	color: #555;
}
.success a, .warning a, .attention a, .information a {
	color: #333;
}
#cart-success{
	position: fixed;
	z-index:9998;
}
.success {
	width:140px;/*width of your box*/
	height:140px;/*height of your box*/
	position:fixed;
	left:50%;
	top:50%;
	margin-left:-70px;/*Half of your width*/
	margin-top:-70px;/*Half of your height*/
	z-index:9999;
	background:#FFF url('../image/success3.png') bottom no-repeat;/*Background colour & green Tick image*/
	border:2px solid #38B0E3;-webkit-border-radius:15px 15px 15px 15px;-moz-border-radius:15px 15px 15px 15px;-khtml-border-radius:15px 15px 15px 15px;border-radius:15px 15px 15px 15px;/*border thickness & colour with rounded corners*/
	font-size:16px;/*Size of your text that shows in the box*/
}
.rev-success {
	background: #EAF7D9 url('../image/success.png') left no-repeat;
	border: 1px solid #BBDF8D;
	padding-left:20px;
}
/*End added*/]]></add>
		</operation>
	</file>
        <file name="catalog/view/javascript/common.js">
		<operation>
			<search position="after"><![CDATA[$('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
				}
			}	 ]]></search>
			<add><![CDATA[        /*Begin added by Harryo*/
			if (json['success']) {
				$('#cart-success').after('<div class="success" style="display: none;">' + json['success'] + '</div>');

				$('.success').fadeIn(1000).delay(2000).fadeOut(1500);

			$('#cart_total').html(json['total']);
/*End added*/]]></add>
		</operation>
<operation>
			<search position="after"><![CDATA[function addToWishList(product_id) {
	$.ajax({
		url: 'index.php?route=account/wishlist/update',
		type: 'post',
		data: 'product_id=' + product_id,
		dataType: 'json',
		success: function(json) {
			$('.success, .warning, .attention, .information').remove();]]></search>
			<add><![CDATA[        /*Begin added by Harryo*/
			if (json['success']) {
				$('#cart-success').after('<div class="success" style="display: none;">' + json['success'] + '</div>');
				
				$('.success').fadeIn(1000).delay(3000).fadeOut(1500);
				
				$('#wishlist_total').html(json['total']);
/*End added*/]]></add>
		</operation>
<operation>
			<search position="after"><![CDATA[function addToCompare(product_id) { 
	$.ajax({
		url: 'index.php?route=product/compare/update',
		type: 'post',
		data: 'product_id=' + product_id,
		dataType: 'json',
		success: function(json) {
			$('.success, .warning, .attention, .information').remove();]]></search>
			<add><![CDATA[        /*Begin added by Harryo*/
			if (json['success']) {
				$('#cart-success').after('<div class="success" style="display: none;">' + json['success'] + '</div>');
				
				$('.success').fadeIn(1000).delay(3000).fadeOut(1500);
				
				$('#compare_total').html(json['total']);
/*End added*/]]></add>
		</operation>
	</file>
</modification>
OR

Active Member

Posts

Joined
Thu Sep 01, 2011 9:14 am

Post by harryo40 » Tue Oct 11, 2011 3:54 pm

Hi Victor,
I have looked into this & also created it with VQMod & also tested & working with OC 1.5.1.3 as can now been seen on the demo site ;)
http://demo.next2nowt.com
I will re-upload later today, when i know everything is working as it should be. I will post in the support forum...
http://forum.opencart.com/viewtopic.php?f=112&t=40487 once uploaded & also in the comments of the mod.
Once I know all is working, the download will contain all files to manually upload & also the VQMod version (done & testing with the latest VQMod 2.1.2 :)

Add To Cart Confirm Ajax Popup for OC 1.5.1.3 --> 1.5.5.1 - Add to Cart Confirmation Popup
Image Map Banner Module - Image Map Banner Module
----------------------------------------------------------------------
Womens Famous Name Fashion Clothing at bargain prices - Next2nowt.com


Active Member

Posts

Joined
Wed Oct 21, 2009 3:37 am
Location - Blackburn, Lancashire

Post by harryo40 » Tue Oct 11, 2011 10:29 pm

Re-Uploaded zipped files including VQMod version & tested on OC 1.5.1.3

Add To Cart Confirm Ajax Popup for OC 1.5.1.3 --> 1.5.5.1 - Add to Cart Confirmation Popup
Image Map Banner Module - Image Map Banner Module
----------------------------------------------------------------------
Womens Famous Name Fashion Clothing at bargain prices - Next2nowt.com


Active Member

Posts

Joined
Wed Oct 21, 2009 3:37 am
Location - Blackburn, Lancashire

Post by victor.gatto » Wed Oct 12, 2011 11:10 am

YAY thanks heaps :)

Active Member

Posts

Joined
Thu Sep 01, 2011 9:14 am
Who is online

Users browsing this forum: No registered users and 7 guests