email layouts

MM0233
Phoca Member
Phoca Member
Posts: 20
Joined: 02 Feb 2018, 18:18

email layouts

Post by MM0233 » 11 May 2018, 17:22

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: 20
Joined: 02 Feb 2018, 18:18

Re: email layouts

Post by MM0233 » 14 May 2018, 18:05

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: 39981
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: email layouts

Post by Jan » 14 May 2018, 22:23

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: 20
Joined: 02 Feb 2018, 18:18

Re: email layouts

Post by MM0233 » 15 May 2018, 15:43

[SOLVED]
Perfect! Problem solved. Necessary upgrade. And you, precoius as always. Thank you.

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 39981
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: email layouts

Post by Jan » 17 May 2018, 00:28

Ok
If you find Phoca extensions useful, please support the project

andraspal
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 16 May 2018, 19:46

Re: email layouts

Post by andraspal » 04 Jun 2018, 09:48

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: 39981
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: email layouts

Post by Jan » 06 Jun 2018, 23:06

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

Jan
If you find Phoca extensions useful, please support the project

andraspal
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 16 May 2018, 19:46

Re: email layouts

Post by andraspal » 06 Jun 2018, 23:26

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