Community Forums

Discuss, share and get help from our community of friendly WHMCS users

Close
Login to Your Account
Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Order Summary in non cart pages

    Hello,

    Is there any way to display "Order Summary" block (or any other mini cart block) in other WHMCS pages but not in sidebar as I don't use sidebar in my page?

    Thank you
    Chris
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  2. #2
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,416

    Default Re: Order Summary in non cart pages

    Hi Chris,

    Quote Originally Posted by ChrisTERiS View Post
    Is there any way to display "Order Summary" block (or any other mini cart block) in other WHMCS pages but not in sidebar as I don't use sidebar in my page?
    outside of the cart? I suppose if you could access the session variables, you'd have a fighting chance...

    but if all you wanted to do was show the number of items in the cart and/or cart value, then you could use Data Feeds.

    ideally, what are you trying to do ?

  3. #3
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by brian! View Post
    ....what are you trying to do ?
    That's a very good question Brian ...... Well in fact I'm trying to add some stuff in my eShop. Keeping the engine I'm redesigning the Shop section by adding dedicated page for each product with a lot of needing (for Coders/Designer) details. If you see the screenshots at: https://forum.whmcs.com/showthread.p...-Shop&p=515618 you'll get my meaning.
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  4. #4
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,416

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by ChrisTERiS View Post
    That's a very good question Brian ...... Well in fact I'm trying to add some stuff in my eShop. Keeping the engine I'm redesigning the Shop section by adding dedicated page for each product with a lot of needing (for Coders/Designer) details. If you see the screenshots at: https://forum.whmcs.com/showthread.p...-Shop&p=515618 you'll get my meaning.
    i'm struggling to see the link between the addon and the details within ordersummary.

    I suspect ordersummary requires cart.php to function properly (e.g provide the variables/arrays), so outside of cart you would effectively have to reproduce the arrays for it (or something similar to work), and as the cart is session based, you'd need to access that too.

    perhaps it will make more sense to me when you post images from the client side of the addon.

  5. #5
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by brian! View Post
    i'm struggling to see the link between the addon and the details within ordersummary. .
    Not everything can be perfect. This is the dark point but comparing with the benefits of having a dedicated and full of details page, it seems to be uninmportant.
    I'll manually modify 1 or 2 templates. Actually is the categories block which I think that I can replace with my own with a hook, and that "Order Summary" which has a link to "Continue Shopping". Just keep in mind that clicking "Buy Now" will redirects to normal cart page. I'm not replacing the functionality. When I released my old mod it had double (maybe more) sales than the forum module.
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  6. #6
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by brian! View Post
    i'm struggling to see the link between the addon and the details within ordersummary.
    .
    You can get a first idea at https://www.teriakis.com/shop.php
    Still most links are not working.
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  7. #7
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,416

    Default Re: Order Summary in non cart pages

    in the finished addon, will the order now button add it to the cart, or is everything going to be done outside of the existing cart process?

  8. #8
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by brian! View Post
    in the finished addon, will the order now button add it to the cart, or is everything going to be done outside of the existing cart process?
    Try it .... Just don't be confused with the different price.
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  9. #9
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,416

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by ChrisTERiS View Post
    Try it .... Just don't be confused with the different price.
    oh ok, you've updated the order now button link to go to the cart (it wasn't before)... now it makes some sense!

  10. #10
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by brian! View Post
    oh ok, you've updated the order now button link to go to the cart (it wasn't before)... now it makes some sense!
    Yes, I activated the link. From that point everything will follows normal WHMCS procedure. The only that I'll change are the categories block links to point at shop.php instead of cart.php so if someone wants to browse categories to go to my pages. The second change is to find and change any "Continue Shopping" links to point to my pages. That's all.

    But as you maybe seen the advantages are much more than disadvantages.

    PS: I mean advantages for those who want to show product details. eg Hosting providers don't need them.
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  11. #11
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,416

    Default Re: Order Summary in non cart pages

    Hi Chris,

    three thoughts/suggestions on this if I may...

    1. the currency format of the e-shop pricing is different from the cart pricing format...



    I don't mean the actual pricing, e.g 25 in one, 35 in the other - I specifically mean that the e-shop would show it as 35.00 but the cart would show it as 35,00 - though going from the admin screenshots, that might just be a typo on your part...

    also, can e-shop handle products being priced in multiple currencies ??

    2. the order summary issue... looking at the design, I suppose you could put the order summary into a panel... I still suspect you'd need to query the session and then run those values into a db search if you wanted to get product names etc, but i'm sure it could be done (if you had to!).

    3. from the client side, is there any reason why the output has to be a separate page and outside of the cart ?? I get what you say about if you're selling hosting, you can use the cart, and if selling software etc, use e-shop... but there might be those who want to do both and to have two separate systems might be a little confusing to end-users...

    i'm wondering if it would be simpler to create a custom orderform template - all you would likely need is a custom products.tpl template (using your current output) and then for other pages it falls back to standard_cart - though if there are no domains/product configurations, then they'll only see products.tpl, viewcart and checkout... the advantage to that is that you're in the cart so will have easier access to cart variables rather than having to try to recreate them from outside... and for the end-user, they can easily switch from ordering hosting products/domains/software all in the same cart...

    if it were a separate orderform template, then you could assign specific templates to the appropriate product groups.. e.g domains use standard_cart, VPS hosting uses one of the ugly comparison templates and software uses the e-shop template...

    though I assume your addon isn't adding products to the standard db tables as such but to a custom table... perhaps if it could add the basic information to the default tblproducts table and then pull additional information from the custom table, that might be a way to make them work together.

    anyway, as you say, there are pros & cons to your method, and there are also pros & cons too to having it as an orderform template... but I think it's worth at least giving some thought to it.

  12. #12
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by brian! View Post
    Hi Chris,

    three thoughts/suggestions on this if I may...
    Thank you for your time to post these suggestions.


    Quote Originally Posted by brian! View Post
    1. the currency format of the e-shop pricing is different from the cart pricing format...



    I don't mean the actual pricing, e.g 25 in one, 35 in the other - I specifically mean that the e-shop would show it as 35.00 but the cart would show it as 35,00 - though going from the admin screenshots, that might just be a typo on your part...
    Price is a free text input. eg in this example I've used:
    Code:
    &euro;35<sup>.00</sup>
    As I said these pages, at least for now, are just for product presentation and nothing more.

    Quote Originally Posted by brian! View Post
    also, can e-shop handle products being priced in multiple currencies ??
    On the way that the system works now, no is not possible, unless if you manually enter all the prices in the price field. Not so professional.

    Quote Originally Posted by brian! View Post
    2. the order summary issue... looking at the design, I suppose you could put the order summary into a panel... I still suspect you'd need to query the session and then run those values into a db search if you wanted to get product names etc, but i'm sure it could be done (if you had to!).
    I left it as last task todo. First I need to finish all other elements in the page.

    Quote Originally Posted by brian! View Post
    3. from the client side, is there any reason why the output has to be a separate page and outside of the cart ?? I get what you say about if you're selling hosting, you can use the cart, and if selling software etc, use e-shop... but there might be those who want to do both and to have two separate systems might be a little confusing to end-users...
    Everybody can use it. It's just my opinion that maybe those who're selling hosting packages don't need it. ef what to add as Photo Gallery etc?

    Quote Originally Posted by brian! View Post
    i'm wondering if it would be simpler to create a custom orderform template - all you would likely need is a custom products.tpl template (using your current output) and then for other pages it falls back to standard_cart - though if there are no domains/product configurations, then they'll only see products.tpl, viewcart and checkout... the advantage to that is that you're in the cart so will have easier access to cart variables rather than having to try to recreate them from outside... and for the end-user, they can easily switch from ordering hosting products/domains/software all in the same cart...

    if it were a separate orderform template, then you could assign specific templates to the appropriate product groups.. e.g domains use standard_cart, VPS hosting uses one of the ugly comparison templates and software uses the e-shop template...
    I've added a few only fields in tblproducts table. But I can add all there and in this case I can use the default templates. But what about php queries? Not sure but I think that in my previous version I was using PHP in templates. New Smarty version has by default PHP disabled. I seen that there is an option to activate it but don't know how many webmasters will be happy to do it.

    So if I can't use PHP in templates means that I must run some queries by hooks. I'm not familiar with hooks and don't know if this can be done easy or not (if it can be done at all).

    Quote Originally Posted by brian! View Post
    though I assume your addon isn't adding products to the standard db tables as such but to a custom table... perhaps if it could add the basic information to the default tblproducts table and then pull additional information from the custom table, that might be a way to make them work together.
    Correct. I tried to use the minimum additions. Most data are storing in separate tables.

    Thank you for your time
    Chris

    - - - Updated - - -

    ........addition...........

    In my previous version I was getting almost all pricing with queris. eg to get addons list I was using:
    Code:
    // AddOns
    $browse_addons = array();
    $sql_addons = mysql_query("SELECT * FROM tbladdons");
    while($addon = mysql_fetch_array($sql_addons)) {
                 $split = explode(",", $addon["packages"]);
                 if(in_array($productid, $split))
                 {
                    $activeaddonid = $addon["id"];
                    $sql_addon_price = mysql_query("SELECT * FROM tblpricing WHERE type='addon' AND relid=$activeaddonid LIMIT 1");
                    $rlt_addon_price = mysql_fetch_assoc($sql_addon_price);
                    $addon["setup"] = getFormatPrice($rlt_addon_price["msetupfee"]);
                    $addon["amount"] = getFormatPrice($rlt_addon_price["monthly"]);
                    array_push($browse_addons, $addon);
                 }
    }
    but almost all clients asked me to let pricing in manual enter mode.
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  13. #13
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,416

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by ChrisTERiS View Post
    I've added a few only fields in tblproducts table. But I can add all there and in this case I can use the default templates. But what about php queries? Not sure but I think that in my previous version I was using PHP in templates. New Smarty version has by default PHP disabled. I seen that there is an option to activate it but don't know how many webmasters will be happy to do it.
    no you don't want to be asking users to enable that option.

    Quote Originally Posted by ChrisTERiS View Post
    So if I can't use PHP in templates means that I must run some queries by hooks. I'm not familiar with hooks and don't know if this can be done easy or not (if it can be done at all).
    well I would imagine you know enough about the two core features of hooks that you'll need - namely using PHP and querying the database... the only things you'll need to figure out is the v7 way to query the db and then returning the results back to the template.

    as a very rough demo, imagine you want to access the addons table in the template, e.g querying tbladdons..

    PHP Code:
    <?php

    use Illuminate\Database\Capsule\Manager as Capsule;

    function 
    demo_addons_hook($vars) {

        
    $productid '2';
        
    $sql_addons Capsule::table('tbladdons')
                    ->
    join('tblpricing''tbladdons.id''=''tblpricing.relid')
                    ->
    where('tbladdons.packages',$productid)
                    ->
    where('tblpricing.type','addon')
                    ->
    groupBy('tbladdons.id')
                    ->
    get();
        
        
    $encodedata json_encode($sql_addons);
        
    $decodedata json_decode($encodedatatrue);

        return array(
    "myaddons" => $decodedata);
    }
    add_hook("ClientAreaPage"1"demo_addons_hook");
    ?>
    that will create a Smarty array of addons ($myaddons) for a given product, along with it's pricing etc... and you can either output that array in the template, access specific values... or even modify it in the hook further (using PHP) before you pass the array(s) back to the template.

  14. #14
    Join Date
    Oct 2007
    Location
    Thessaloniki, Greece
    Posts
    209

    Default Re: Order Summary in non cart pages

    Brrrr.... json .... Ok, I got it. Meanwhile I gave a look at order templates. My God, seems that they're more than all clientarea templates. Do I need to modify all of them? Needs years :P
    What templates used on these pages (I think that I need only these 2 pages);
    https://www.teriakis.com/cart.php
    https://www.teriakis.com/cart.php?a=confproduct&i=0

    In the 2nd page, which is the most important if I need to add product details there, I must:
    1.- Remove sidebar
    2.- Add Breadcrumb so user can move back
    3.- Place configure (main section) on the right, over Order Summary. This way I'll have space to show product details.
    ChrisTERiS
    PHP Freelancer - vBulletin Specialist

  15. #15
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,416

    Default Re: Order Summary in non cart pages

    Quote Originally Posted by ChrisTERiS View Post
    Brrrr.... json .... Ok, I got it. Meanwhile I gave a look at order templates. My God, seems that they're more than all clientarea templates. Do I need to modify all of them? Needs years :P
    What templates used on these pages (I think that I need only these 2 pages);
    https://www.teriakis.com/cart.php
    https://www.teriakis.com/cart.php?a=confproduct&i=0
    front page of the cart is products.tpl, second link will be configureproduct.tpl

    Quote Originally Posted by ChrisTERiS View Post
    In the 2nd page, which is the most important if I need to add product details there, I must:
    1.- Remove sidebar
    2.- Add Breadcrumb so user can move back
    3.- Place configure (main section) on the right, over Order Summary. This way I'll have space to show product details.
    sidebar could effectively be removed by removing the includes to the sidebar templates (if you want it gone completely).

Page 1 of 2 12 LastLast

Similar Threads

  1. Order Summary Show Other Pages
    By FlyHost in forum Developer Corner
    Replies: 11
    Last Post: 02-14-17, 05:54 PM
  2. [Not A Bug] VAT does not reflect in the Cart Summary of Ajax Order Template
    By SindreM in forum Troubleshooting Issues
    Replies: 1
    Last Post: 12-26-13, 05:13 PM
  3. Floating Cart Summary floats to far!
    By kristofferR in forum Using WHMCS
    Replies: 1
    Last Post: 10-03-11, 07:34 PM
  4. [NOT A BUG] Cart summary box on ajax order form
    By magga in forum Troubleshooting Issues
    Replies: 6
    Last Post: 04-11-11, 07:49 PM

Posting Permissions

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