getOrderByCartId(intval($id_cart)) Prestashop Function

July 1st, 2010 by chris barton No comments »

the getorderByCart function simply returns the order_id when the input is a cart_id, located in /classes/order.php the function is as follows

/**
	 * Get an order by its cart id
	 *
	 * @param integer $id_cart Cart id
	 * @return array Order details
	 */
	static public function getOrderByCartId($id_cart)
    {
    	$result = Db::getInstance()->getRow('
        SELECT `id_order`
        FROM `'._DB_PREFIX_.'orders`
        WHERE `id_cart` = '.intval($id_cart));

		return isset($result['id_order']) ? $result['id_order'] : false;
    }

example of use

$myid_order = Order::getOrderByCartId(intval($id_cart));

prestashop shop seo page loading speed

June 8th, 2010 by chris barton No comments »

While trying to increase page speeds load, it would make sense to use the google cdn.

now if your prestashop does not use ssl it is an easy change

just edit header.tpl

find

<script type="text/javascript" src="{$content_dir}js/jquery/jquery.easing.1.3.js"></script>

and change to

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>

now if your site is ssl secured its a bit more complicated, as you need the call to jquery to be supplied from an https source.

you could just call

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>

from every page, but an https call takes slightly longer than a straight http call

their are several ways you can achieve the desired results, mainly involving lost of {if} loops in the header to ensure the correct protocol is used

but a far easier way is as follows

edit init.php in you web root and add the following code after

google site map module ignores canonical url setting

June 7th, 2010 by chris barton No comments »

Just found out that when generating a site map with the google site map module it completely ignores the canonical url setting in presatshop

so all your site map links will point to http://www. even if you have your canonical url set to just the http:// domain without the www. subdomain,

attached file should fix this problem, its a bit quick and nasty but it works

gsitemap

Prestashop Uk address format

June 7th, 2010 by chris barton No comments »

This will show you how to change the default layout of addresses in prestashop to UK format.

The first this we always do when doing an install is to move the UK out of the Ecc zone and create a new UK zone and ad the UK to this, Simply reason this helps in the shipping set up later.

Creating a site with prestashop 1.3 Part One

May 27th, 2010 by chris barton No comments »

We will; be working on http://firestriker.co.uk a site for selling light my fire products

First of all download a copy of the latest version of prestashop from http://prestashop.com

Once downloaded unzip all the files

to upload to your server you will need a ftp, the one we use is filezilla which is available from http://filezilla-project.org.

Download the ftp client and install. you do not need the server version.

To setup filezilla you will need to know your ftp username and password for your server.

Start filezilla and click on File -> SiteManager and select new site.

Enter you details into the correct boxes

site name which should be your ftp server

you then have to change the login type to normal

and enter your ftp username and ftp password

once you have entered all your details click on connect and if you have everything entered correctly you should be conected to your ftp server

To be continued

prestashop featured products under categorys that have subcategorys

May 24th, 2010 by chris barton No comments »

thinking of displaying random products underneath the subcategory boxes, only when the category has subcategorys, of course you can do this by placing the product in the subcategory and the main category

but it does not appear in a featured box

so the code that detects if sub categorys are present is as follows

{if isset($subcategories)}

more info to follow

Hide the wishlist block from unlogged in users on prestashop

May 21st, 2010 by chris barton No comments »

I have always thought it is a bit pointless showing the wishlist box all the time, generally because the feature is only available to logged in users, so if you have people browsing the site it is just a empty box

so to make it visible to only customers who have a account and are logged in edit blockwishlist.tpl in you modules/wishlist directory

Just wrap the whole block with the following code

 {if logged}

{/if}

simply and then the block only appear when the user is logged in

Socialbookmarking for ebay

March 18th, 2010 by chris barton No comments »

Proof of concept

social bookmarking for prestashop

March 11th, 2010 by chris barton No comments »

After looking at a few actinic shops and noticed that quite a few had started to implement the ability to add social bookmarks on the product page tabs, after searching around for a prestashop module that did the same, I could not find anything that did the job, so I came up with this simple module. the look of the page by editing the socialbookmarks.tpl file

You can see it in action here. social bookmarks

Download: socialbookmarks for products

store designer database driven ebay listings

January 29th, 2010 by chris barton No comments »

After looking how frooition produce their ebay templates, I wondered if it was possible to produce dynamic ebay lisings, basically this would enable you to aler youe ebay listing, without having to even touch ebay or use their api,

Well after two days of playing around with php, mysql and javascript, I came up with the following listing template

http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&rd=1&item=250570029692&ssPageName=STRK:MESE:IT

The title, pictures and description are all pulled from a mysql database, meaning you can alter the listing from your own backend on your website.

The categories and items are all produced via the ebay api, and can be updated at any time

This is more proof on concept rather than a working enviroment,