email layouts

Phoca Cart - complex e-commerce extension
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

email layouts

Post by MM0233 »

Hello again,
Where can I found layouts for emails of the various order statuses?
I'd like to make some style changes and change the SKU code with ISBN code on the bill.
Thank you.

Tags:
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

Re: email layouts

Post by MM0233 »

Ok found here: components/com_phocacart/layouts/order.php
but now i need the query to add the isbn, someone can tell me where can i found it? I've searched in libraries folder but i didn't found it.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: email layouts

Post by Jan »

Hi,
for now there is no such option.

You can do it for now this way:
open this file: administrator\components\com_phocacart\libraries\phocacart\product\product.php

and add this function there:

Code: Select all

public static function getProductCodes($id) {
		
		$db 		= JFactory::getDBO();
		$wheres		= array();
		$wheres[] 	= ' a.id = '.(int)$id;
		$query = ' SELECT a.sku, a.upc, a.ean, a.jan, a.isbn, a.mpn, a.serial_number'
				.' FROM #__phocacart_products AS a' 
				.' WHERE ' . implode( ' AND ', $wheres )
				.' ORDER BY a.id'
				.' LIMIT 1';
		$db->setQuery($query);
		$productCodes = $db->loadAssoc();
		
		return $productCodes;
	}
(I will add this function into the next version, so it will be not needed to add it in future again)

and then in order: components\com_phocacart\layouts\order.php

on line cca: 472 after:

Code: Select all

	foreach($d['products'] as $k => $v) {
add:

Code: Select all

$codes = PhocacartProduct::getProductCodes((int)$v->product_id);
		// echo $codes['isbn'];
This way you can get the isbn of the product (but be aware the isbn is loaded from current product, not from oder which was made, so if the isbn of the product will change in future, you will always get the latest isbn not the isbn which was valid in date of order)

Jan
If you find Phoca extensions useful, please support the project
MM0233
Phoca Member
Phoca Member
Posts: 22
Joined: 02 Feb 2018, 18:18

Re: email layouts

Post by MM0233 »

[SOLVED]
Perfect! Problem solved. Necessary upgrade. And you, precoius as always. Thank you.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: email layouts

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
andraspal
Phoca Member
Phoca Member
Posts: 32
Joined: 16 May 2018, 19:46

Re: email layouts

Post by andraspal »

I have blank images in emails. This is where those images should be coming from:
https://ci6.googleusercontent.com/proxy ... a-cart.png

https://ci4.googleusercontent.com/proxy ... ca-pos.png
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: email layouts

Post by Jan »

Hi, I get 404 when displaying the links :idea:

Jan
If you find Phoca extensions useful, please support the project
andraspal
Phoca Member
Phoca Member
Posts: 32
Joined: 16 May 2018, 19:46

Re: email layouts

Post by andraspal »

Sorry, those were really long urls, but anyway, the end part is interesting: http:///media/com_phocacart/images/phoca-cart.png

That url is hardcoded somewhere, somehow in phocacart. I manually altered it so its ok now, but I guess it should be fixed at some stage.
Post Reply