Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Margin Report v2.10


blueline

Recommended Posts

hi ive installed the margin report.(latest version)

 

all works ok, apart from index/categories.php

 

i get this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/skycards/skycards.net/admin/includes/functions/database.php on line 99

 

when i revert back to original page i dont get the error.

 

Any know why this happens???

Link to comment
Share on other sites

I'm having a problem with Margin Reports transferring the product cost over into the orders table. It doesn't want to move it when an order is made, thus making all orders look like pure profit. Any ideas? As of right now I have to constantly go into my database and manually enter the product costs to show accurate reports.

Link to comment
Share on other sites

Yes I look at it, and what doesn't it do? it works good for me.

 

In my previous thread I stated that it's not transferring the products cost into the orders table when something is purchased, therefore showing all items as costing $0.00 when I run a report. And yes I did enter the costs of the products when I created them in the catalog.

Link to comment
Share on other sites

I have re-installed 2.56 and still get

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #29' at line 1

 

Resource id #29

 

[TEP STOP]

 

when I select a Manufacture and then do a All Catagories by Manufacture. Otherwise the other reports work.

Link to comment
Share on other sites

  • 2 weeks later...

I've got a couple of issues I could use some help with.

 

1. In margin_report2, I have this on line 134:

 

while ($prods = mysql_fetch_array($prods_query, MYSQL_ASSOC)) {

 

If I don't comment it out, I get the following error:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/baddogse/public_html/catalog/admin/margin_report2.php on line 134

 

2. When I select a report (like daily, weekley, etc.), I get nothing but zeros.

 

3. When I try to export, I get stuff like <table width="1050" border="1" cellspacing="0" cellpadding="2"> in the spreadsheet but no report.

 

Suggestions as to what to look at/for would be appreciated, especially if you've had similar problems and fixed them.

Edited by baddog
Link to comment
Share on other sites

I'm still having issues with the products costs being inserted into the orders_products table when an order is generated.  No answers yet makes me think this board has been abandoned.

I took the front end stuff (the changes to /includes/classes/order.php and shopping cart.php and /checkout_process.php) out after finding out that if a customer tried to check out, they got an error page after clicking on the confirm button. At the same time, I would get the money and an order would be recorded, but no products were in the order so I couldn't tell what had been ordered and in order history it showed a blank order. I didn't want to screw around with it since the store is live. I can still use some of the back end stuff (I also dropped the reports that didn't work and the export feature, since I couldn't get that to work either). I guess I still like what is left and it is useful, just not as good as if I could get all of the features working.

Link to comment
Share on other sites

I took the front end stuff (the changes to /includes/classes/order.php and shopping cart.php and /checkout_process.php) out after finding out that if a customer tried to check out, they got an error page after clicking on the confirm button.  At the same time, I would get the money and an order would be recorded, but no products were in the order so I couldn't tell what had been ordered and in order history it showed a blank order.  I didn't want to screw around with it since the store is live.  I can still use some of the back end stuff (I also dropped the reports that didn't work and the export feature, since I couldn't get that to work either).  I guess I still like what is left and it is useful, just not as good as if I could get all of the features working.

 

I must be doing good then because the only thing I cant get to work is what I stated before. I have to go into the database through phpMyAdmin and add the products_cost data after-the-fact. It's not incredibly bad but it can be a pain since accessing the database like that is rather annoying.

Link to comment
Share on other sites

  • 2 weeks later...

I just installed this 10 mins ago and everything works fine for me. There was 2 or 3 places in the directions that I believe were left out.

 

On the shopping cart page

 

The two places it tells you to add

 

$products_cost = $product['products_cost'];

 

'cost' => $products['products_cost'],

 

It didn't tell you to add the products_cost, to the query. It also does this on the order.php page. So just add that in the query and you should cure your problem of the cost not showing up for your reports. Make sure the directions didn't leave any other places out like that as I corrected them as I went and the reports works fine for me.

Link to comment
Share on other sites

I just installed this 10 mins ago and everything works fine for me.  There was 2 or 3 places in the directions that I believe were left out.

 

On the shopping cart page

 

The two places it tells you to add

 

$products_cost = $product['products_cost'];

 

'cost' => $products['products_cost'],

 

It didn't tell you to add the products_cost, to the query.  It also does this on the order.php page.  So just add that in the query and you should cure your problem of the cost not showing up for your reports.  Make sure the directions didn't leave any other places out like that as I corrected them as I went and the reports works fine for me.

 

Hey thanks....that was the cause of the problem. That single lack of a db query. I should have known better myself :wacko:

Link to comment
Share on other sites

What is it "not" doing with paypal? Not putting the price in the table? Paypal ipn is a whole other beast, I've had to tweak mine for 3 other mods I installed.... other payment systems work, but paypal is a pain.

 

 

If you are using paypal you need to add this for the margin report to record the cost for a paypal sale.

 

in includes/modules/payment/paypal_ipn.php

Find:

 ? ? ? ? ? ?$sql_data_array = array('orders_id' => $insert_id,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_id' => 

tep_get_prid($order->products[$i]['id']),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_model' => $order->products[$i]['model'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_name' => $order->products[$i]['name'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_price' => $order->products[$i]['price'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'final_price' => $order->products[$i]['final_price'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_tax' => $order->products[$i]['tax'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_quantity' => $order->products[$i]['qty']);

 

And Make it this:

 

 ? ? ? ? ? ?$sql_data_array = array('orders_id' => $insert_id,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_id' => 

tep_get_prid($order->products[$i]['id']),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_model' => $order->products[$i]['model'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_name' => $order->products[$i]['name'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_price' => $order->products[$i]['price'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_cost' => $order->products[$i]['cost'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'final_price' => $order->products[$i]['final_price'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_tax' => $order->products[$i]['tax'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'products_quantity' => $order->products[$i]['qty']);

 

 

Works perfectly now :)

 

Hope that helps someone.

 

WebPixie

Edited by WebPixie
Link to comment
Share on other sites

  • 3 weeks later...
If you are using paypal you need to add this for the margin report to record the cost for a paypal sale.

 

in includes/modules/payment/paypal_ipn.php

Find:

            $sql_data_array = array('orders_id' => $insert_id,
                                   'products_id' => 

tep_get_prid($order->products[$i]['id']),
                                   'products_model' => $order->products[$i]['model'],
                                   'products_name' => $order->products[$i]['name'],
                                   'products_price' => $order->products[$i]['price'],
                                   'final_price' => $order->products[$i]['final_price'],
                                   'products_tax' => $order->products[$i]['tax'],
                                   'products_quantity' => $order->products[$i]['qty']);

 

And Make it this:

 

            $sql_data_array = array('orders_id' => $insert_id,
                                   'products_id' => 

tep_get_prid($order->products[$i]['id']),
                                   'products_model' => $order->products[$i]['model'],
                                   'products_name' => $order->products[$i]['name'],
                                   'products_price' => $order->products[$i]['price'],
                                   'products_cost' => $order->products[$i]['cost'],
                                   'final_price' => $order->products[$i]['final_price'],
                                   'products_tax' => $order->products[$i]['tax'],
                                   'products_quantity' => $order->products[$i]['qty']);

Works perfectly now :)

 

Hope that helps someone.

 

WebPixie

 

 

I must have a different version of the PayPal IPN...mine's Greg Baloolal's Version 2.3...works fine so I don't plan to upgrade anytime soon unless I build a fresh store.

Link to comment
Share on other sites

HI, a great contribution and very useful to me. However I have problems getting it to work with Osc2.2 installed with ACA. The margin report works fine but the shop is not now. After placing orders, when customer checkout, it shows blank screen and when customer review their order also blank screen. May have more problem. Just a few I notice. Possible to advise how to integrate your MOD to ACA? Thanks in advance.

Link to comment
Share on other sites

Hi, additional notes to my problem in the last posting. As mention in the posting above who have the same problem as mine, have to revert the /include/classes/order.php & shopping_cart.php (means without changes as of margin report installation) and /checing_process.php files back to before to resolve this problem. Wonder what difference can we see/impact if we did/didn't follow the instructions to include the changes as per margin report installation notes. Thanks for advise.

Link to comment
Share on other sites

I finished with the installation of this contrib but when I try to access Categories from Administrator Panel, I get:

 

1054 - Unknown column 'p.products_cost' in 'field list'

 

select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_cost, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '21' order by pd.products_name

 

[TEP STOP]

 

Could someone advice what I did wrong please?

Link to comment
Share on other sites

  • 4 weeks later...

Attributes? Is this in the works or has this feature been abandoned? This is probably the most frustrating part about such a great contribution. It's like having a ferrari without the wheels. How many of us use attributes on our store? I for one have em on just about every product. Therefore this contribution cannot accurately give a correct profit based off of this one detail that seems to have been overlooked during the design process.

 

Has anyone else been able to come up with a fix for this? If so - could you please update the contribution and post it for the rest of us. I'm not a programming junkie - just a little here and there. So, obviously a change of this magnitude is beyond my comprehension. For all I know it may not even ever be able to do this. Any guidance would be appreciated.

 

Sincerely,

Christopher Caruso

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...