Community Forum

If you have questions about my software, chances are this forum has the answers.

You'll need to register before you can post on the forum to ask your question or to answer another one. A reply will be posted to each and every question that is asked so there is no need to double post or bump your post. I do my best to answer promptly but in some cases it may take a day or two. If you bump your post, it may be removed. Bear with me and I`ll get your question answered quickly.

Here are a few tips to help you to get your questions answered more rapidly.

IMPORTANT: Posts in English only. I don't have a translator and I'll be unable to understand your message properly and will probably delete it.
SEARCH: Use the search option to see if your question has been answered on the forum before now or if there is an answer in the documentation of your software.
PRIORITY SUPPORT: If you have purchased a commercial version of any software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
LINKS: Any links posted are not clickable and must be copied / pasted into your browser address bar.

You are not logged in.

#1 jjjjeczalik 10-10-2018 00:44:20

Surely there is a simple way to echo this number.

This is no bug or error; rather I seem to be ignorant as to how to do it. I asked something similar about two years ago and you (David!) were kind enough to prove a valuable clue (the entire answer, really).

$this->BASKET_COUNT is a number which equals zero or whatever the current number of items is in the basket. My site contains a number of pages that are "outside" of the store; I want a person to still be able to see that they have a shopping cart with items in it (and this span would like to the actual basket page rather than cause the modal window to display, since the modal window isn't included in the page anyway).

I created a separate file (arbitrarily titled cartcount.php) and tried several different methods to make the "value" of it the BASKET_COUNT but none of them worked. And they all seems rather intensive (parsing the DOM of the store's front page, for example) for the sake of just retrieving what is ordinarily a single-digit number.

I've done similar things before (pulled small amounts of data like stock prices or commodity prices from sites that I don't even run and inserted the data into my own) so it bothers me that I'm running into so much trouble.

(Unrelated: I downloaded 2.5 and did a fresh installation a few weeks ago; all of the improvements are pretty swell.)

#2 msworld 10-10-2018 02:43:00

Thank you. smile

You can easily call the basket count via the cart class. Note that the pages outside of your store must have an active session.

@session_start();

If the session exists, you don`t need the above code.

include(path_to_music_system/control/classes/class.cart.php);
$c = new cart();
echo $c->count();

Adjust the path to be the correct path to the cart class. smile

#3 jjjjeczalik 10-10-2018 11:16:47

Excellent; thanks for this tip.

#4 msworld 10-10-2018 15:57:45

You are welcome. smile

Board footer

Maian Script World - Free PHP Software for Personal or Business Use.
© 2003-2018 Maian Script World & David Ian Bennett.

2Checkout.com is an authorized reseller of goods and services provided by Maian Script World

Free PHP Software / Responsive PHP Scripts / Lightweight PHP Software / White Label PHP Software