Include fichier dans les emails

  • Posts: 453
  • Thank you received: 31
  • Hikamarket Multivendor Hikashop Business
2 years 4 months ago #343244

-- HikaShop version -- : 4.6.0

Bonjour,

J'essai d'include un fichier php contenant des variables pour gagner du temps sur la personnalisation des emails dans Hikashop mais le fichier n'est pas appelé et les variables ne sont donc pas prises en compte.

Avez-vous une solution ?

En vous remerciant par avance

Bien cordialement

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
2 years 4 months ago #343246

Bonjour,

Afin de mieux vous répondre pouvez préciser un peu votre idée et votre besoin ?
Et plus spécifiquement ce que vous entendez par "variables" et le fichier php, soyez le plus détaillé possible afin de nous permettre des conseils qui vous soit spécifique et surtout éfficace pour votre besoin.

Cordialement

Last edit: 2 years 4 months ago by Philip.

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

  • Posts: 453
  • Thank you received: 31
  • Hikamarket Multivendor Hikashop Business
2 years 4 months ago #343260

Au temps pour moi Philip, peut être un problème de cache ou autre, tout fonctionne correctement maintenant.

Je souhaitai simplement chargé un fichier "var_email.php" contenant des variables pour modifier le style des balises sans devoir copier/coller les variables dans chaque fichier, ci-dessous le code en question

<?php

/**
 * @package	HikaShop for Joomla!
 * @version	4.5.1
 * @author	hikashop.com
 * @copyright	(C) 2010-2022 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');



include('var_email.php');
?>

<table class="w600" border="0" cellspacing="0" cellpadding="0" width="600" style="<?= $size_normal . $font_family . $line_height . $color; ?>">
    <tr>
        <td class="w20" width="20"></td>
        <td class="w560 pict" width="560">
            <div id="title">

                <h1 style="<?= $size_h1 . $center . $padding_section . $color . $border_none; ?>">
                    {TXT:ORDER_TITLE}
                </h1>

                <h2 style="<?= $size_normal . $center . $padding_section . $color . $line_height . $border_top . $border_bottom; ?>">
	{TXT:ORDER_CHANGED}
    </h2>
            </div>
        </td>
        <td class="w20" width="20"></td>
    </tr>
    <tr>
        <td class="w20" width="20"></td>
        <td style="<?= $bg_light; ?>">
            <div class="w550" width="550" id="content" style="<?= $size_normal . $font_family . $line_height . $left; ?>">
                <!-- <p>
                <h3 style="<?= $size_h3 . $center . $padding_section . $color; ?>">{TXT:HI_CUSTOMER}</h3>
                {TXT:ORDER_BEGIN_MESSAGE}
                </p> -->

                <table class="w550" border="0" cellspacing="0" cellpadding="0" width="550">
                    <tr>
                        <!--{IF:BILLING_ADDRESS}-->
                        <td style="<?= $size_h3 .  $color_client . $padding_section; ?>">{TXT:BILLING_ADDRESS}</td>
                        <!--{ENDIF:BILLING_ADDRESS}-->
                        <!--{IF:SHIPPING}-->
                        <!--{IF:SHIPPING_ADDRESS}-->
                        <td style="<?= $size_h3 .  $color_client . $padding_section; ?>">{TXT:SHIPPING_ADDRESS}</td>
                        <!--{ENDIF:SHIPPING_ADDRESS}-->
                        <!--{ENDIF:SHIPPING}-->
                    </tr>
                    <tr>
                        <!--{IF:BILLING_ADDRESS}-->
                        <td style="<?= $size_normal . $font_family . $line_height; ?>">{VAR:BILLING_ADDRESS}</td>
                        <!--{ENDIF:BILLING_ADDRESS}-->
                        <!--{IF:SHIPPING}-->
                        <!--{IF:SHIPPING_ADDRESS}-->
                        <td style="<?= $size_normal . $font_family . $line_height; ?>">{VAR:SHIPPING_ADDRESS}</td>
                        <!--{ENDIF:SHIPPING_ADDRESS}-->
                        <!--{ENDIF:SHIPPING}-->
                    </tr>
                </table>

                <h1 style="<?= $size_h3 . $padding_section. $color_client . $border_none; ?>">
                    {TXT:SUMMARY_OF_YOUR_ORDER}
                </h1>
                <!--{START:VENDOR_LINE}-->
                <!--{IF:VENDOR_CONTENT}-->{VAR:VENDOR_CONTENT}
                <!--{ENDIF:VENDOR_CONTENT}-->
                <table class="w550" border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tr>
                        <td style="<?= $size_normal . $weight_bold .  $color_client . $padding_section . $border_bottom; ?>">{TXT:PRODUCT_NAME}</td>
                        {TXT:CUSTOMFIELD_NAME}
                        <!--<td style="<?= $size_normal . $weight_bold .  $color_client . $padding_section . $border_bottom; ?>">{TXT:PRODUCT_PRICE}</td>-->
                        <td style="<?= $size_normal . $weight_bold .  $color_client . $center . $padding_section . $border_bottom; ?>">{TXT:PRODUCT_QUANTITY}</td>
                        <td style="<?= $size_normal . $weight_bold .  $color_client . $right . $padding_section . $border_bottom; ?>">{TXT:PRODUCT_TOTAL}</td>
                    </tr>
                    <!--{START:PRODUCT_LINE}-->
                    <tr>
                        <td style="<?= $padding_product . $border_product; ?>">
                            {LINEVAR:PRODUCT_IMG}
                            {LINEVAR:PRODUCT_NAME}
                            <!--{IF:ORDER_PRODUCT_CODE}--> {LINEVAR:PRODUCT_CODE}
                            <!--{ENDIF:ORDER_PRODUCT_CODE}-->
                            {LINEVAR:PRODUCT_DOWNLOAD}
                            {LINEVAR:PRODUCT_DETAILS}
                        </td>
                        {LINEVAR:CUSTOMFIELD_VALUE}
                        <!--<td style="">{LINEVAR:PRODUCT_PRICE}</td>-->
                        <td style="<?= $center . $padding_product . $border_product; ?>">{LINEVAR:PRODUCT_QUANTITY}</td>
                        <td style="<?= $right . $padding_product . $border_product; ?>">{LINEVAR:PRODUCT_TOTAL}</td>
                    </tr>
                    <!--{END:PRODUCT_LINE}-->
                    <!--{START:ORDER_FOOTER}-->
                    <tr>
                        <td class="{LINEVAR:CLASS}_label" colspan="2" style="<?= $right . $weight_bold . $padding_section; ?>">{LINEVAR:NAME}</td>
                        <td class="{LINEVAR:CLASS}_value" style="<?= $right . $padding_section.$weight_bold; ?>">{LINEVAR:VALUE}</td>
                    </tr>
                    <!--{END:ORDER_FOOTER}-->
                </table>
                <!--{END:VENDOR_LINE}-->
                <!--{IF:PAYMENT}-->
                <p>
                    <span style="<?= $size_h3 .  $color_client . $padding_section; ?>">{TXT:PAYMENT_METHOD} :</span> {VAR:PAYMENT}
                </p>
                <!--{ENDIF:PAYMENT}-->
                <!--{IF:SHIPPING}-->
                <p>
                    <span style="<?= $size_h3 .  $color_client . $padding_section; ?>">{TXT:HIKASHOP_SHIPPING_METHOD} :</span> {VAR:SHIPPING}
                </p>
                <!--{ENDIF:SHIPPING}-->
                <!--{IF:ORDER_SUMMARY}-->
                <h1 style="<?= $size_h3 .  $color_client . $padding_section . $border_none; ?>">
                    {TXT:ADDITIONAL_INFORMATION}
                </h1>
                <p style="">
                    {VAR:ORDER_SUMMARY}
                </p>
                <!--{ENDIF:ORDER_SUMMARY}-->
                <!-- <p>
                    {TXT:ORDER_END_MESSAGE}
                </p> -->
            </div>
        </td>
        <td class="w20" width="20"></td>
    </tr>
</table>
<?php


$bg_light = 'background-color:#ffffff;';
$bg_gray_1 = 'background-color:#f9f9f9;';
$bg_gray_2 = 'background-color:#f5f5f5;';
$bg_gray_3 = 'background-color:#f1f1f1;';
$color = 'color:#38305b !important;';
$color_client = 'color:#c769bd;';
$font_family = 'font-family:Arial, Helvetica,sans-serif;';
$size_normal = 'font-size:17px;';
$size_h1 = 'font-size:30px;';
$size_h2 = 'font-size:26px;';
$size_h3 = 'font-size:22px;';
$size_h4 = 'font-size:18px;';
$weight_bold = 'font-weight:bold;';
$line_height = 'line-height:1.5;';
$padding_section = 'padding:20px 0;';
$padding_bottom = 'padding-bottom:10px;';
$center = 'text-align:center;';
$right = 'text-align:right;';
$left = 'text-align:left;';
$pointer = 'cursor:pointer;';
$border_none = 'border:none;';
$border_top = 'border-top:3px solid #c769bd;';
$border_bottom = 'border-bottom:3px solid #c769bd;';
$decoration = 'text-decoration:none;';
$padding_product = 'padding:5px;';
$border_product = 'border-bottom:1px solid #f5f5f5';


Désolé pour le dérangement.

The following user(s) said Thank You: nicolas

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

Time to create page: 0.064 seconds
Powered by Kunena Forum