• Resolved rkrista

    (@rkrista)


    Hi, I’m testing the coupon, but there is a serious problem with it. I added a 30 EUR value coupon to the cart, but the discount appearing at the cart page corresponds to the total value of the products, not to the coupon value. For example, when I have products in the cart with a total value of 495 EUR, the discount will be 495 EUR. How to solve this issue?

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter rkrista

    (@rkrista)

    Two other issues occured:
    – I translated the notification email (the one which is sent to the client) with Loco Translate and it works well. However, the download link in the email doesn’t work. I translated it properly though. I only can view and download the coupons from the WP dashboard.
    – I have coupon values in two different currencies set up. It works perfectly until the payment is done, the chosen values in the chosen currency appear at checkout. However, the coupon value will correspond to the currency that the client used for payment, not the one that had been chosen. The result is that the value that appears on the coupon is not a nice round value, but something like 34,24 EUR.
    Do you have a solution for these issues?

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi @rkrista,

    thank you for your message!

    What version of the plugin are you using?

    Please send the coupon/ gift card URL (both download links) and the URL of the product page (pdf coupon).
    Also, send the screenshot of the settings of the Product in the PDF Coupon tab.

    And the screenshot of coupons created in the Marketing->Coupons menu.
    The coupon value will use the active WooCommerce currency (which is the default WooCommerce behaviour).

    The price of the coupon is based on the WooCommerce price settings and the tax.
    You may change the price, WooCommerce->Settings->Tax settings for the appropriate tax rate, and check the net/gross setting for inserting product prices in WooCommerce.

    Best regards,

    Thread Starter rkrista

    (@rkrista)

    Hi,
    Thanks for your answer!

    I understand now the currency issue, that’s fine then.

    It’s only the translation problem that needs to be solved. I haven’t published the coupon as a product yet, so I can’t send you the url.
    Coupons ordered through the English version of my website work fine, but translated ones don’t. The translated email is sent out and the file can be downloaded, but can’t be opened. Would it help if I forwarded you the emails? Could you give me an email address?

    Thank you!

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi,

    thank you for your reply.

    Could you create a test order with the coupon in the second language and send the URL?

    Please send the translated flexible-coupons.po file (if you use one for translating the plugin – to what directory have you put the translated file).

    Please send also the email template file – coupon.php from:
    flexible-coupons/src/Views/emails

    You may point to these files or use for example https://wetransfer.com/

    Best regards,

    Thread Starter rkrista

    (@rkrista)

    Hi Tomasz,
    Thanks for your answer!

    Could you create a test order with the coupon in the second language and send the URL?

    Could you precise please, Tomasz? I’m not sure what URL you need.

    I haven’t used a po file, I translated directly through the Loco Translate plugin.

    The email template is quite short, I can copy it here for you:

    <?php
    /**
    * Email z kuponem
    */

    if ( ! defined( ‘ABSPATH’ ) ) exit; // Exit if accessed directly ?>

    <?php do_action( ‘woocommerce_email_header’, $email_heading, $email ); ?>

    <h1><?php printf( esc_html__( ‘Hi %s,’, ‘flexible-coupons’), $order->get_billing_first_name() . ‘ ‘ . $order->get_billing_last_name() ); ?></h1>

    <p><b><?php printf( esc_html__( ‘In response to an order %s placed %s, we are sending you a coupon for shopping in our shop.’, ‘flexible-coupons’), $order_number, $date_order ) ; ?></b></p>

    <p>“><?php esc_html_e( ‘Download PDF with the coupon ?’, ‘flexible-coupons’); ?></p>

    <?php if ( isset( $meta[‘coupon_code’] ) ): ?>
    <p><?php printf( esc_html__( ‘Coupon code: %s’, ‘flexible-coupons’ ), $meta[‘coupon_code’] ); ?></p>
    <p><?php printf( esc_html__( ‘Coupon value: %s’, ‘flexible-coupons’ ), $meta[‘coupon_value’] ); ?></p>
    <p><?php printf( esc_html__( ‘Expiry date: %s’, ‘flexible-coupons’ ), date_i18n( wc_date_format(), $meta[‘coupon_expiry’] ) ); ?></p>
    <?php endif; ?>

    <p><?php esc_html_e( ‘Thanks for reading!’, ‘flexible-coupons’); ?></p>

    <?php do_action( ‘woocommerce_email_footer’ ); ?>

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi @rkrista,

    thank you for your reply.

    The url of the link in the email “under”:
    Download PDF with the coupon ?

    Please change the to plain ' and
    <p>“><?php esc_html_e( ‘Download PDF with the coupon ?’, ‘flexible-coupons’); ?></p>

    to

    <p><?php esc_html_e( 'Download PDF with the coupon &raquo;', 'flexible-coupons'); ?></p>

    There is an additional “> at the beginning.

    Also, change
    ?
    to
    &raquo;

    or other HTML to inside the templates.

    Let me know if that helped.

    Best regards,

    Thread Starter rkrista

    (@rkrista)

    Hi,
    Sorry for my late reply and thanks for your advise!

    The code slightly changed since then. I didn’t modify it though.
    But I made the changes you advised anyway. It didn’t help unfortunately.

    This is the URL in the latest email:
    https://nonkonform.hu/hu/?fcpdf=download&coupon_id=8073&hash=98c851a4053de4d9d3b050da345539d6

    I’ve just realized that it’s not possible to change ? to &raquo;. I save it, but it still shows ?.
    This is the code currently:

    <?php
    /**
     * Email z kuponem
     */
    
    if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
    
    <?php do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
    
    <h1><?php printf( esc_html__( 'Hi %s,', 'flexible-coupons'), $order->get_billing_first_name() . ' ' . $order->get_billing_last_name() ); ?></h1>
    
    <p><b><?php printf( esc_html__( 'In response to an order %s placed %s, we are sending you a coupon for shopping in our shop.', 'flexible-coupons'), $order_number, $date_order ) ; ?></b></p>
    
    <p><a href="<?php echo $meta['coupon_url']; ?>"><?php esc_html_e( 'Download PDF with the coupon ?', 'flexible-coupons'); ?></a></p>
    
    <?php if ( isset( $meta['coupon_code'] ) ): ?>
    	<p><?php printf( esc_html__( 'Coupon code: %s', 'flexible-coupons' ), $meta['coupon_code'] ); ?></p>
    	<p><?php printf( esc_html__( 'Coupon value: %s', 'flexible-coupons' ), $meta['coupon_value'] ); ?></p>
    	<p><?php printf( esc_html__( 'Expiry date: %s', 'flexible-coupons' ), date_i18n( wc_date_format(), $meta['coupon_expiry'] ) ); ?></p>
    <?php endif; ?>
    
    <p><?php esc_html_e( 'Thanks for reading!', 'flexible-coupons'); ?></p>
    
    <?php do_action( 'woocommerce_email_footer' ); ?>
    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi rkrista,

    thank you for your reply.

    Try with this rule added to the .htaccess:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^fcpdf=(.*)$
    RewriteRule ^hu/?$ $1 [R=301,L]

    That should help to properly show the coupon in the browser.

    Let me know if that helped.

    Best regards,

    Thread Starter rkrista

    (@rkrista)

    Hi Tomasz,

    Thank you for sending me the code through! I managed to add it to the .htaccess file, but it didn’t solve the problem unfortunately.

    This is the URL in the latest email:
    https://nonkonform.hu/hu/?fcpdf=download&coupon_id=8812&hash=bd2bcc15dbcb894df9616db5148e7035

    Do you have any other idea how to solve this issue?
    Thank you for your efforts!

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi rkrista,

    is your environment Apache-based?

    Could you send the status of your shop from WooCommerce->Status?

    Thread Starter rkrista

    (@rkrista)

    Hi Tomasz,
    Yes, I think it’s Apache-based.
    Do I copy the status here? Sorry, but I’m not sure if it contains sensitive data or not.
    Thank you! ??

    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi rkrista,

    thank you.

    You may send here (the version of WooCommerce/ WordPress + the list of plugins and the server environment info) that you may find in the WooCommerce->Status menu).

    You do not need to put the whole status. You may also see your plugins/ .htaccess if there are any additional rules for rewriting. Also, try to refresh the permalink settings in the Settings->Permalinks menu in your store/ WordPress and delete cache.

    Best regards,

    Thread Starter rkrista

    (@rkrista)

    Hi,

    I managed to copy the data you asked for:

    ### WordPress Environment ###
    
    WordPress address (URL): https://nonkonform.hu
    Site address (URL): https://nonkonform.hu
    WC Version: 5.3.0
    REST API Version: ? 5.3.0
    WC Blocks Version: ? 4.9.1
    Action Scheduler Version: ? 3.1.6
    WC Admin Version: ? 2.3.0
    Log Directory Writable: ?
    WP Version: 5.7.2
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.4.9
    PHP Post Max Size: 64 MB
    PHP Time Limit: 180
    PHP Max Input Vars: 3000
    cURL Version: 7.52.1
    OpenSSL/1.0.2u
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.1.48-MariaDB-0+deb9u2
    Max Upload Size: 64 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Active Plugins (35) ###
    
    Livemesh Addons for Elementor: by Livemesh – 6.10
    Advanced Coupons for WooCommerce Free: by Rymera Web Co – 1.3.7
    Advanced Custom Fields: by Elliot Condon – 5.9.6
    Astra Bulk Edit: by Brainstorm Force – 1.2.6
    Starter Templates: by Brainstorm Force – 2.6.7
    Astra Widgets: by Brainstorm Force – 1.2.8
    Async JavaScript: by Frank Goossens (futtta) – 2.20.12.09
    Element Pack Lite - Addon for Elementor: by BdThemes – 2.10.1
    Code Snippets: by Code Snippets Pro – 2.14.1
    Ele Custom Skin: by Dudaster.com – 3.1.0
    Elementor Pro: by Elementor.com – 3.2.2
    Elementor: by Elementor.com – 3.2.3
    Flexible PDF Coupons for WooCommerce: by WP Desk – 1.4.1
    Google Analytics for WordPress by MonsterInsights: by MonsterInsights – 7.17.0
    Elementor - Header, Footer & Blocks: by Brainstorm Force
    Nikhil Chavan – 1.5.9
    
    Integration for Szamlazz.hu & WooCommerce: by Viszt Péter – 5.3.0.4
    Loco Translate: by Tim Whitlock – 2.5.2
    Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue: by Sendinblue – 3.1.13
    MailOptin - Lite: by MailOptin Team – 1.2.36.1
    Really Simple SSL: by Really Simple Plugins – 4.0.15
    Rank Math SEO: by Rank Math – 1.0.64
    Sticky Header Effects for Elementor: by Rwattner – 1.4.3
    TranslatePress - Multilingual: by Cozmoslabs
    Razvan Mocanu
    Madalin Ungureanu
    Cristophor Hurduban – 2.0.1
    
    Unlimited Elements for Elementor: by Unlimited Elements – 1.4.72
    UpdraftPlus - Backup/Restore: by UpdraftPlus.Com
    DavidAnderson – 1.16.56
    
    WooCommerce Custom Product Addons (Free): by Acowebs – 2.4.15
    WooCommerce Admin: by WooCommerce – 2.3.0
    WooCommerce Stripe Gateway: by WooCommerce – 5.2.0
    Booster for WooCommerce: by Pluggabl LLC – 5.4.0
    Sendinblue - WooCommerce Email Marketing: by Sendinblue – 2.0.17
    WooCommerce: by Automattic – 5.3.0
    Woolementor: by Woolementor – 2.4.0
    Wordfence Security: by Wordfence – 7.5.3
    WP Content Copy Protection & No Right Click: by wp-buy – 3.4
    WP Super Cache: by Automattic – 1.7.3
    
    ### Inactive Plugins (4) ###
    
    Autoptimize: by Frank Goossens (futtta) – 2.8.4
    CartFlows: by CartFlows Inc – 1.6.14
    Flexible Checkout Fields: by WP Desk – 3.0.10
    Kadence WooCommerce Email Designer: by Kadence WP – 1.4.7
    
    ### Dropin Plugins (1) ###
    
    advanced-cache.php: advanced-cache.php

    And this is what I found at the .htaccess section:

    # BEGIN LSCACHE
    # END LSCACHE
    # BEGIN NON_LSCACHE
    # END NON_LSCACHE
    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    # Wordfence WAF
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    	Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    	Order deny,allow
    	Deny from all
    </IfModule>
    </Files>
    # END Wordfence WAF

    I updated the permalinks and deleted cache.
    Tell me if you need any more information.
    Thank you, Tomasz!

    • This reply was modified 3 years, 6 months ago by rkrista.
    Plugin Support tomasz_bednarek

    (@tomasz_bednarek)

    Hi rkrista,

    thank you.

    Please add the rule to the .htaccess:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^fcpdf=(.*)$
    RewriteRule ^hu/?$ $1 [R=301,L]

    See if Wordfence Security is not deleting the rule afterwards.

    Then try to visit the coupon URL.

    Best regards,

    Thread Starter rkrista

    (@rkrista)

    Hi,
    Sorry for my late answer and thank you for your suggestions! I tested the coupon again, but it still doesn’t work
    https://nonkonform.hu/hu/?fcpdf=download&coupon_id=9379&hash=94e7a098dbb9ce9b814de91953420dc2

    I double-checked the rule in the .htaccess file and it hasn’t been deleted, it’s still there.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘coupon value issue’ is closed to new replies.