recuperer un champ product dans l'email

  • Posts: 2667
  • Thank you received: 68
10 years 10 months ago #173161

-- HikaShop version -- : 233
-- Joomla version -- : 334

dans la table product j'ai un champ perso que je voudrais afficher dans l'email de notification

comment recuperer cette valeur qui n'est pas un champ order ?

je peux bien sur faire une requete SQL dans le preload.modified s'il n'y a pas d'autre solution

merci

Last edit: 10 years 10 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 10 months ago #173179

Bonjour,

Cf votre question d'il y a 9 mois.
www.hikashop.com/forum/5-support-en-fran...urer-pour-email.html

Cordialement


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 2667
  • Thank you received: 68
10 years 10 months ago #173239

justement je ne recuperes rien

et un var_dump( $item) ou var_dump($data->cart) ne me donnes aucun champ perso , donc je ne vois pas bien comment je pourrais les rajouter a part une requete SQL dans le preload

donc j'ajoutes ca comment ? je fais une requete SQL ou hikashop a deja une methode ?


merci

Last edit: 10 years 10 months ago by erickb.

Please Log in or Create an account to join the conversation.

  • Posts: 84220
  • Thank you received: 13671
  • MODERATOR
10 years 10 months ago #173241

Comme a expliqué Jérome dans l'autre sujet, il n'est pas nécessaire de modifier le préload pour les champs personnalisés.
Il suffit d'utiliser le tag comme ceci:
{LINEVAR:item.lieferdatum}

Please Log in or Create an account to join the conversation.

  • Posts: 2667
  • Thank you received: 68
10 years 10 months ago #173401

justement ca ne marche pas

dans mon preload

$cartProduct = array(
			'PRODUCT_CODE' => $item->order_product_code,
			'PRODUCT_QUANTITY' => $item->order_product_quantity,
			'PRODUCT_IMG' => '',
			'item' => $item,
			'product' => $product,
			'CHARACTERISTIC_VALUE' => $item->order_product_options[0]->characteristic_value,
			'PRODUCT_LIEFERDATUM' => $item->product_lieferdatum ,
		);


dans email
<tr>
<td>
a : {LINEVAR:PRODUCT_LIEFERDATUM}
<br />
b : {LINEVAR:item.product_lieferdatum}
</td>
</tr>

resultat
a : {LINEVAR:PRODUCT_LIEFERDATUM}
b : {LINEVAR:item.product_lieferdatum}

comme j'ai dis avant un var_dump($item) ne me donne pas cette valeur donc je vois pas bien comment elle pourrait etre recuperee

Please Log in or Create an account to join the conversation.

  • Posts: 2667
  • Thank you received: 68
10 years 10 months ago #173402

je ne le recupere que comme ça (en l'ajoutant puisqu'il n'y est pas)

$q = $db->getQuery(true);     	
      	$q->select('product_lieferdatum');
	  	$q->from($db->quoteName('#__hikashop_product'));
	  	$q->where($db->quoteName('product_id')." = ".$db->quote($item->product_id));
	  	$db->setQuery($q);

		$cartProduct = array(
			'PRODUCT_CODE' => $item->order_product_code,
			'PRODUCT_QUANTITY' => $item->order_product_quantity,
			'PRODUCT_IMG' => '',
			'item' => $item,
			'product' => $product,
			'CHARACTERISTIC_VALUE' => $item->order_product_options[0]->characteristic_value,
			'PRODUCT_LIEFERDATUM' => $db->loadResult() ,
		);

Please Log in or Create an account to join the conversation.

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
10 years 10 months ago #173406

Bonjour,

On va donc revenir un peu sur les bases :
Un champ personnalisé de type produit est dans "product".
Un champ personnalisé de type item est dans "item".

Donc, au lieu de vous pendre la tête à chercher dans "item" ou dans le cart ; merci d'utiliser le code exact que je vous donnais il y a 9 mois.
Et donc pour un champs de produit ce sera: {LINEVAR:product.lieferdatum}

Cordialement,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 10 years 10 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 2667
  • Thank you received: 68
10 years 10 months ago #173528

ok je recommence un nouveau sujet sinon on s'yperd

Last edit: 10 years 10 months ago by erickb.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum