Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Apr 2006
    Location
    City Drama in Greece
    Posts
    160
    Plugin Contributions
    6

    Default Re: How can I check order status and then show protected content ?

    Hi again !!!

    I would like to ask if there is any way to see a result of a statement before I put it in the code; like :

    $wanted_status_num = "select * from " .TABLE_ORDERS_STATUS_HISTORY . "
    where orders_id = '" . $orders_id . "'
    order by orders_status_id desc limit 1";

    Can I see the value witch is assigned to the variable and how ?

    This would help a lot !!

    Thanks in advance.

  2. #12
    Join Date
    Apr 2006
    Location
    City Drama in Greece
    Posts
    160
    Plugin Contributions
    6

    Default Re: How can I check order status and then show protected content ?

    Well, I am practicing a lot and I hope with some more help ( to understand some issues ) I will manage to do what I want.

    Sorry for all this code here, but this is my practice and I am so happy that I do not get syntax errors any more ( I only "echo" the db Execution and I take an "Object" - I'll see what I can do with this later anyway; I just want it to show now ) .

    I remember ...20 years ago!!! my first "contact" with a Commodore 64; my fingers typing " hello pc " and pressing RETURN...and then on TV screen (!) reading SYNTAX ERROR !!!

    This is happening right now; this is what we call cycle of life. Me again, trying to cummunicate with the database tables to get some values :) ;

    MY CODING FOR TODAY IS THE FOLLOWING :

    ########################################################################################################################____

    <div class="centerColumn" id="accountDefault">
    <h1 id="accountDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
    <?php if ($messageStack->size('account') > 0) echo $messageStack->output('account'); ?>

    <?php

    $anamoni = "Αναμένεται πληρωμή για την ενεργοποίηση της συνδρομής σας";

    $lixis = "Η Συνδρομή σας έχει λήξει";

    $visa = "Έχετε επιπλέον 15 ημέρες, διότι πληρώσατε με VISA";

    $subscribers_menu = '<center>
    <object id="banner_automove" width="577" height="120"
    classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">
    <param name="movie" value="testmembers.swf" />
    <param name="quality" value="high" />
    <param name="scale" value="noscale"/>
    <param name="bgcolor" value="#FFFFFF" /><param name="wmode" value="transparent" /><embed name="banner_automove" src="testmembers.swf" quality="high" scale="noscale"
    bgcolor="#FFFFFF" wmode="transparent" width="577" height="120"
    type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
    </center>';

    $wanted_status_name = "select * from " . TABLE_ORDERS_STATUS . "
    where orders_status_name = 'delivered'";

    $status_name = $db->Execute($wanted_status_name);

    echo "$status_name";

    ?><br><?php

    $wanted_status_num = "select * from " . TABLE_ORDERS_STATUS_HISTORY . "
    where orders_id = '" . $orders_id . "'
    order by orders_status_id desc limit 1";

    $status_num = $db->Execute($wanted_status_num);

    echo "$status_num";

    ?><br><?php

    $wanted_payment_method = "select * from " . TABLE_ORDERS . "
    where payment_module_code = 'cc'";

    $pay_method = $db->Execute($wanted_payment_method);

    echo "$pay_method";

    ?><br><?php

    if ($status_num == 3):
    echo "$subscribers_menu";
    elseif ($status_num == 1):
    print"$anamoni";
    elseif ($pay_method == "cc"):
    echo "$visa";
    else:
    print"$lixis";
    endif;

    ?>



    WELL , by using this code I take the following :

    Object // from the first statement
    Object // from the second statement
    Object // from the third statement
    Η Συνδρομή σας έχει λήξει // from variable $lixis from else:


    I can do some basics ( at least ) without SYNTAX ERROR.

    As for the Objects I did not find what I wanted in PHP manual.

    So, please help me at this time to understand how to code.

    Thanks in advance.

  3. #13
    Join Date
    Jan 2007
    Posts
    88
    Plugin Contributions
    0

    Default Re: How can I check order status and then show protected content ?

    This is great I have very much wanted to do something like this where they would have to login before they could see the newest products.

    Could you also perhaps give some insight into where I should edit for this?

    Here is the thread with some of my questions on this: http://www.zen-cart.com/forum/showthread.php?t=55842

  4. #14
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: How can I check order status and then show protected content ?

    Quote Originally Posted by lebrand2006

    I would like to ask if there is any way to see a result of a statement before I put it in the code; like :

    $wanted_status_num = "select * from " .TABLE_ORDERS_STATUS_HISTORY . "
    where orders_id = '" . $orders_id . "'
    order by orders_status_id desc limit 1";

    Can I see the value witch is assigned to the variable and how ?
    After you execute this code, you can simply loop through the results and echo them out...
    Code:
    $sql = "select * from " .TABLE_ORDERS_STATUS_HISTORY . " 
            where orders_id = '" . $orders_id . "'
            order by orders_status_id desc limit 1";
    
    $wanted_status_num = $db->Execute($sql);
    while (!$wanted_status_num->EOF) {
      print_r($wanted_status_num->fields);
      echo "<br /> \n";
      $wanted_status_num->MoveNext();
    }
    Pay attention to the fact that I renamed the variable on your SQL statement and moved it to the results of that statement.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

  5. #15
    Join Date
    Apr 2006
    Location
    City Drama in Greece
    Posts
    160
    Plugin Contributions
    6

    Default Re: How can I check order status and then show protected content ?

    Hello again.

    Well, I managed to do what I want, but only by checking the first order.

    I made a lot of modifications to tpl_account_default ( Attached File ).

    I first added an IF command to check if somebody has no orders and then I inform the user and provide a spesific link ( any link ).

    The second IF command is unchanged, and if there are more that 0 orders, the following IF's working :

    <?php

    if ($orders['orders_status_name'] == 3){

    echo ACTIVE_SUBSCRIBERS_MENU;

    } elseif ($orders['orders_status_name'] == 1){

    echo PAYMENT_PENDING;

    } elseif ($orders['orders_status_name'] == 2){

    echo PRE_ACTIVATION_STATUS;

    } elseif ($orders['orders_status_name'] == 4){

    echo SUBSCRIPTION_EXPIRED;

    }

    ?>

    I just changed the status names to numbers from 1 to 4.

    I use some defines to provide the content to the user.

    But I will change this. I will use frames in the defines; specificaly two frames in a define ( the one I call "protected content" ) , splited verticaly. One small frame to keep a menu ( flash menu or anything alse ) and another one to show the content. This content for now will be hosted in an unprotected area, so I should find a way to protect it.

    This is very easy with PLESK or any other virtual server managment software ( like cPanel etc. ) ; I will just make a protected file, i will define a username and password and put all protected content in there.

    The problem ( at least for me now ) is how to POST username and password, inside the PHP code, when I demand to show a page that is located in that protected folder on my server.

    Lets's say I need to show a page "test.html" that is located in a protected folder witch needs username and password.

    Lets's say that I use 2 frames splited verticaly. In the top frame I use a flash menu. This seems to be a problem, because ( I am not sure ) I believe that I will need to POST username and password with some kind of BUTTON PROCCES to the protected folder.

    Is there any idea how to do something like this ?

    ##################################################################################################################################

    Another issue in my mind is that we should work on some ideas for subscription module in Zen Cart. Because of the fact that we can handle downloads in Zen, I think we can work on this parallel like we handle subscriptions.

    ##################################################################################################################################_

    I also include attached, a Credit Card Payment module for Greek Bank Eurobank.

    I found that module at osCommerce and I modified it, so I can install it in Zen 1.3.7

    I managed to install this module after the modifications but I am waiting for the bank to provide me with Merchant ID and password so I can test if the module is working. This bank uses ProxyPay3.

    Well, the files are attached. If somebody can check it from the Zen Cart team, please let me know if there are any wrong modifications or something is missing.

    I also provide the original osCommerce files.

    Thanks to all of you

  6. #16
    Join Date
    Nov 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: How can I check order status and then show protected content ?

    Strange things with this bank.
    They want 5 things to open a demo account and test the script.
    These are:
    1) check out
    2) validation
    3) ok
    4) not ok
    5) confirmation

    Which is which and why this bank doesnt have a simple module for 4-5 commerce carts to just plug and play?!!

    Please, reply ASAP.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 How can I show delivery city and state on the order history page?
    By mello_me in forum Managing Customers and Orders
    Replies: 1
    Last Post: 18 Apr 2014, 11:10 PM
  2. How can I show more review content on product revew page?
    By lina0962 in forum Managing Customers and Orders
    Replies: 3
    Last Post: 5 Jun 2013, 12:30 AM
  3. Can I add under the customer's account their order histor and order status??
    By flash01 in forum Customization from the Admin
    Replies: 8
    Last Post: 28 Nov 2010, 09:49 PM
  4. change order status email content
    By demz001 in forum General Questions
    Replies: 2
    Last Post: 25 Nov 2008, 03:06 AM
  5. php check domain name and then redirect
    By forced in forum General Questions
    Replies: 4
    Last Post: 16 Aug 2008, 01:15 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR