Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2010
    Posts
    6
    Plugin Contributions
    1

    Default Template code only for a certain module

    Hi

    hopefully a simple one! My knowledge of php is limited! I need to add a message into my checkout template but I only want it to display if a certain payment module is being used. I have got the message to display for all payment options but I need it only for one (ceon manual cards)

    So I guess I am asking is how do I say

    if (module xxx)

    Thanks in advance!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Template code only for a certain module

    You can test for the Payment method that is selected with:
    $_SESSION['payment']

    One test for the current shipping and payment methods is to add to the file:
    /includes/templates/your_template_dir/common/tpl_main_page.php

    below the <body> the code:
    Code:
    <?php
    echo 'Shipping: ' . $_SESSION['shipping']['id']   . ' Payment: ' . $_SESSION['payment'] . '<br>';
    ?>
    that will then display the selected choices as you navigate the checkout so you can see what you are testing for ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Apr 2010
    Posts
    6
    Plugin Contributions
    1

    Default Re: Template code only for a certain module

    Hi thanks for the quick reply .....

    Ok so i added that code and got Payment: ceon_manual_card

    My customers get 3 payment options and what I need to be able to is display message that appears next to the the payment method ceon_manual_card. Hope I am making sense here?

    I guess something along the lines of

    if module ceon_manual_card
    echo ......

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Template code only for a certain module

    So you can do something like:
    Code:
    if ($_SESSION['payment'] == 'ceon_manual_card') {
      // do something
    } else {
      // do not do something
    }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Apr 2010
    Posts
    6
    Plugin Contributions
    1

    Default Re: Template code only for a certain module

    Hi Again!

    I really appreciate your help Ajeh

    Thanks for that however that session var is not stored until after the payment method is selected I am talking about the step before where the payment options are displayed... I most likely was not very clear ...

    My customers are given three payment options one of which is the ceon manual cards... what I need to do is display a message next to the ceon option

    this is the place in the template I want to add something in red

    Code:
    <?php echo zen_draw_hidden_field('payment', $selection[$i]['id']); ?>
    	    <?php
    	        }
    	    ?>
    	    <label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?> </label>
    
    
    
    <?php
    if 
    
    module is ceon cards  <------  ?????
     {
      echo $order->info['total'] . ' ' . DEFAULT_CURRENCY;
    } 
    
    ?>
    
    
    	   
    	    <?php
    	        if (defined('MODULE_ORDER_TOTAL_COD_STATUS') && MODULE_ORDER_TOTAL_COD_STATUS == 'true' and $selection[$i]['id'] == 'cod') {
    	    ?>
    I hope that is clearer!

    Once again thanks

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Template code only for a certain module

    Can you edit the language file for it and customize the:
    CEON_MANUAL_CARD_TEXT_CATALOG_TITLE

    to show what you need?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Apr 2010
    Posts
    6
    Plugin Contributions
    1

    Default Re: Template code only for a certain module

    Hi

    Yes tried that first but I cant put PHP in there....

    P

  8. #8
    Join Date
    Apr 2010
    Posts
    6
    Plugin Contributions
    1

    Default Re: Template code only for a certain module

    Or can I?

  9. #9
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Template code only for a certain module

    Hi,

    Why would you need to put PHP in? Is the message supposed to change based on who is logged in? If so, what do you want to add?

    Otherwise, just update the name of the module to be displayed to the user by editing CEON_MANUAL_CARD_TEXT_CATALOG_TITLE as Ajeh says?

    All the best..

    Conor
    ceon

 

 

Similar Threads

  1. v150 Won't show shipping rates for certain zip code
    By susb8383 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 22 Jul 2015, 03:48 PM
  2. v153 Show certain content for for a specific zone definition only
    By dysfunctional in forum General Questions
    Replies: 1
    Last Post: 28 Nov 2014, 02:38 AM
  3. Flat rate or similar module to only display when over a certain weight?
    By sam_m in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 3 Dec 2008, 12:36 AM
  4. Need help with module configuration--enable certain payment module for certain items
    By maxus in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 10 Mar 2008, 04:24 PM
  5. Replies: 0
    Last Post: 6 Mar 2008, 05:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg