Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter gaianhelmers

    (@gaianhelmers)

    Due to the inactivity of the support mod and the urgency of my completing this design I took the function I needed from the plugin and pasted it into my own code so I can call the function as I need.

    I was correct in assuming that awts_get_total_sales_per_product($product_id ='') was the right function. It returns the total ‘number’ of sales as well as the total sales for the product.

    I wrote out my answer more in depth on my Stack Overflow question.

    Thread Starter gaianhelmers

    (@gaianhelmers)

    Yes, in the query for total sales by item it returns the number of sales as well as the sales total.
    Meaning that the number of sales and the amount earned from each sale are separate data points.
    I put a 37.30 dollar contribution in for testing and it displayed exactly that price as earnings. Simple sweet plugin. I love it.

    Thread Starter gaianhelmers

    (@gaianhelmers)

    I’ve been looking at the code in the addon and I see the function I want to call:
    awts_get_total_sales_per_product($product_id ='')

    But I don’t know how to call it from my little shortcode function.

    What do I have to include in my function to be able to refer to that method?

    Edit:
    As I’m reading through your functions, I’m not sure if that’s actually the function I want to call.
    What I want is what I’ve stated in the original question. A function where I call it with a product id as the argument and I receive the earnings that that product has accumulated. I know it already exists in some capacity because you display the product’s earnings in the back end on the edit product page.

    • This reply was modified 7 years, 9 months ago by gaianhelmers. Reason: Adding to the post
    Thread Starter gaianhelmers

    (@gaianhelmers)

    I’ve looked over the resulting code on each of the pages, the wordpress page as well as a testpage I made which is just a basic webpage that calls do_shortcode() to embed the chat window.

    The url’s to the various code are both correct and go to the same directories.

    There doesn’t seem to be any differences to the resulting code unless I’m missing the huge serial numbers and the differences between those.

    However Both pages properly load the previous messages left in the chat however the chat window on the testpage does not have any CSS styling and has no functionality. It cannot post messages, cannot open the emoticon sub-window and does not refresh the chat in any way after the page initially loads the previous messages.

    I’m looking at the javascript between the two pages and the only difference I can see is the checksum.

    WordPress embedded JS:

    <script type="text/javascript">
        (function() {
            var messages = jQuery('#wcd7b7a1a5e03ebb2e529885ea8f1b888a .wcMessages');
            if (messages.length > 0 && 'ascending' == 'ascending') {
                messages.scrollTop(messages[0].scrollHeight);
            }
        })();
    
    	jQuery(window).load(function() {
    		var jsOptions = {"chatId":"wcd7b7a1a5e03ebb2e529885ea8f1b888a","channelId":1,"nowTime":"2016-03-26T01:10:45+00:00","lastId":6,"checksum":"cS0NOKk4qfs36WAVM2i8e45+YZ9QQ+jM\/LNfYTgfZJxV9hg8oTYTPB6c9E74MJwgvMPCbA3yXG5L0E041+CPJ4\/rgsVfk\/CBXOVuWLuzxsb1X0iNGA1YEWmWJfMr6dxx2XBY\/kp5KE\/O2OzWh+HFQ3yHW6OJbMm+GEdsjNbFJMU=","lastActionId":7,"baseDir":"http:\/\/[MY DOMAIN]\/dbsys\/wp-content\/plugins\/wise-chat\/","emoticonsBaseURL":"http:\/\/[MY DOMAIN]\/dbsys\/wp-content\/plugins\/wise-chat\/gfx\/emoticons\/","apiEndpointBase":"http:\/\/[MY DOMAIN]\/dbsys\/wp-content\/plugins\/wise-chat\/src\/endpoints\/","messagesRefreshTime":5000,"messagesOrder":"ascending","enableTitleNotifications":true,"soundNotification":"","messagesTimeMode":"hidden","channelUsersLimit":0,"messages":{"message_sending":"Sending ...","hint_message":"Enter message here","messageSecAgo":"sec. ago","messageMinAgo":"min. ago","messageYesterday":"yesterday","messageUnsupportedTypeOfFile":"Unsupported type of file.","messageSizeLimitError":"The size of the file exceeds allowed limit."},"userSettings":{"muteSounds":false},"attachmentsValidFileFormats":[],"attachmentsSizeLimit":3145728,"imagesSizeLimit":3145728};
    
    		if (typeof(window['wiseChatInstances']) == 'undefined') {
    			window['wiseChatInstances'] = {};
    		}
    
    		if (typeof(window.wiseChatInstances[jsOptions.chatId]) == 'undefined') {
    			window.wiseChatInstances[jsOptions.chatId] = new WiseChatController(jsOptions);
    		}
    	});
    </script>

    Test Page embedded JS:

    <script type="text/javascript">
        (function() {
            var messages = jQuery('#wcf26c80ed3139c5163208943839f58e0c .wcMessages');
            if (messages.length > 0 && 'ascending' == 'ascending') {
                messages.scrollTop(messages[0].scrollHeight);
            }
        })();
    
    	jQuery(window).load(function() {
    		var jsOptions = {"chatId":"wcf26c80ed3139c5163208943839f58e0c","channelId":1,"nowTime":"2016-03-26T01:11:19+00:00","lastId":8,"checksum":"nbU7ZORqZlEfc5T+C6mRZHy5hwsnswSMte8c373ikjdlqIJUovnbHXO1Lt1KfeK5PYLPjRYNATlAn2OBXMiTcJgE4NCDj1V+oOZ1hg6IdhjRoDZ34JxXcyDbsGptwE9+FeTlHh3ootLnWki1FlAw7lRDfVFgV2CGXDQtMkBKH7w=","lastActionId":7,"baseDir":"http:\/\/[MY DOMAIN]\/dbsys\/wp-content\/plugins\/wise-chat\/","emoticonsBaseURL":"http:\/\/[MY DOMAIN]\/dbsys\/wp-content\/plugins\/wise-chat\/gfx\/emoticons\/","apiEndpointBase":"http:\/\/[MY DOMAIN]\/dbsys\/wp-content\/plugins\/wise-chat\/src\/endpoints\/","messagesRefreshTime":5000,"messagesOrder":"ascending","enableTitleNotifications":true,"soundNotification":"","messagesTimeMode":"hidden","channelUsersLimit":0,"messages":{"message_sending":"Sending ...","hint_message":"Enter message here","messageSecAgo":"sec. ago","messageMinAgo":"min. ago","messageYesterday":"yesterday","messageUnsupportedTypeOfFile":"Unsupported type of file.","messageSizeLimitError":"The size of the file exceeds allowed limit."},"userSettings":{"muteSounds":false},"attachmentsValidFileFormats":[],"attachmentsSizeLimit":3145728,"imagesSizeLimit":3145728};
    
    		if (typeof(window['wiseChatInstances']) == 'undefined') {
    			window['wiseChatInstances'] = {};
    		}
    
    		if (typeof(window.wiseChatInstances[jsOptions.chatId]) == 'undefined') {
    			window.wiseChatInstances[jsOptions.chatId] = new WiseChatController(jsOptions);
    		}
    	});
    </script>

    Note: [MY DOMAIN] is just there to protect my in development website.

    Thread Starter gaianhelmers

    (@gaianhelmers)

    Here’s what each page gets in the end:

    WordPress page:

    [Large code excerpt removed by moderator per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.]

    I’ve looked over the URL’s and they seem to all direct to the correct places. I also don’t notice much difference between the two end results so I don’t understand what is the difference.
    Like I had said earlier, querying the previous messages works fine but none of the functionality persists and once the page loads it doesn’t continue to refresh the chat window.

    Thread Starter gaianhelmers

    (@gaianhelmers)

    If I don’t manually refer to the style it goes to a nonexistant directory.
    For example, when I look at the webpage the destination for the css is: href="https://DOMAINNAME.ca/dbsys/wp-content/plugins/wise-chat//themes/default/theme.css"

    Thread Starter gaianhelmers

    (@gaianhelmers)

    Oh I also forgot to mention I have to manually refer to the stylesheet. It doesn’t automatically load with it.

    Thread Starter gaianhelmers

    (@gaianhelmers)

    I’ve made the change but that doesn’t seem to fully fix the issue.

    Currently the previous posts load (those that I made inside the WP install before) the text field loads and the buttons for emoticons and send load.

    However I cannot submit my text and when I click on the emoticon button nothing loads. Basically on the client side I can’t interact with the chat or receive updates. (I just posted within the wordpress install and nothing changes on the out of wordpress version of the same chat channel.)

    What would be the cause of this?

    Thread Starter gaianhelmers

    (@gaianhelmers)

    It appears to me, although I’m very inexperienced with WordPress, is that the references to the files are local to the wordpress folder.

    Would there be any simple way to be able to override the URL’s to be manually directed to the plugin folder?

Viewing 9 replies - 1 through 9 (of 9 total)