Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

  • Index
  •  » ClickCartPro 6
  •  » ADMIN SIDE - Email administrator when inventory level reaches Zero

#76 09-24-2008 08:23:56

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

In admin under Home > ClickCartPro > Commerce: Orders and Checkout > Manage Online Orders (Completed and Processing) click on Update next to the order in question.  The post order flags are near the bottom in the section titled, appropriately enough, "Post-Order Updates".

Offline

 

#77 09-24-2008 20:13:52

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

The only two Order Status choices that get displayed in 'Completed and Processing' from user activity are Not Completed if payment doesn't get completed and Pending Shipment. Only those two. Not Completed is false for inventory being updated and Pending Shipment is true for inventory being updated.

So how does any of this relate to the fact that my if statement isn't working when someone places an order. If it's pending shipment, that means inventory was updated and the email should be fired off?

Offline

 

#78 09-29-2008 06:42:53

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

Dave, my mod (https://forum.kryptronic.com/viewtopic.php?id=17782 - post #25 says what I did (added a ccp0.orderstatus.NC option referred to as Not Completed)) doesn't look like it should have prevented the email from firing off.  Any ideas what I could do to fix it?

Offline

 

#79 09-29-2008 07:04:12

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

Not really James.  That post was by John and I haven't been following that thread or this one closely.

Offline

 

#80 11-15-2008 00:22:09

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

Dave, I got it working - I have the $body of the email showing the URL to the product and a line stating currently inventory level. It works, but I can't get them to be separated on different lines. How do I make a new line or carriage return? I can't get the syntax set right. Here's the line I use:

Code:

$body = 'Current Inventory: ' . $inv . ' gift baskets left.' . ' http://www.mysite.com/index.php?app=ccp0&ns=prodshow&ref=' . $row['id'];

It shows the right inventory amount and the URL links properly to my site's page. Email though shows them next to each other. I'd like the inventory line first and then two new lines, then the URL. \n or variations on that doesn't work.

James...

Offline

 

#81 11-15-2008 06:27:47

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

In the plain text version of a note the use of \n must be between double quotes.  Change the end of that line to:

Code:

$row['id'] . "\n\n";

Offline

 

#82 11-15-2008 07:32:55

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

Thanks Dave, worked like a charm.  Now I'm trying to add the NAME of the product but it's not displaying it:

Code:

$body = "Current Inventory: " . $inv . " gift baskets left.   " . $row['name'] . "\n\n" . "http://www.mysite.com/index.php?app=ccp0&ns=prodshow&ref=" . $row['id'];

Wouldn't the 'name' field get printed exactly like the 'id' field gets printed?

Offline

 

#83 11-15-2008 07:44:40

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

I just realized that MAYBE 'id' is defined in the file but 'name' isn't...but I looked up in the file (0300_inventory) and didn't see any obvious place that id is pre-defined or assigned the value?

correction...

Code:

$sql = "SELECT id, invlevel FROM {$table} WHERE {$where}";

          $result = $this->KHXC_DB->sql_do(array('sql'    => $sql,
                                                 'table'  => $table,
                                                 'order'  => array('id' => 'ASC')));

I don't know if this is where it's being pulled in but would SELECT id, invlevel, name FROM... be what needs to be done?

Last edited by wyattea (11-15-2008 07:46:30)

Offline

 

#84 11-15-2008 08:32:38

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

Ok, i added name to SELECT id, invlevel, name FROM...worked fine. Hopefully it doesn't screw up something else smile but the email worked fine.

Offline

 

#85 11-15-2008 23:17:46

wyattea
Member
Registered: 01-07-2006
Posts: 1650

Re: ADMIN SIDE - Email administrator when inventory level reaches Zero

Dave, I'm having trouble with getting an HTML Email sent. I'm trying to put in headers to indicate content-type but it's still sending the emails as text (and showing the html source as if it's text in the email:

Code:

$body = "<html><head><title>MySite Inventory</title></head><body><p>Current Inventory: " . $inv . " " . $row['name'] . " gift baskets left." . "<br/><br/>" . 
"<a href='http://www.mysite.com/index.php?app=ccp0&ns=prodshow&ref=" . $row['id'] . "'><img src='http://www.mysite.com/media/ccp0/prodlg/" . $row['imglg'] . "'/></a>";

// To send HTML mail, the Content-type header must be set
$headers = "Content-Type: text/html; charset=iso-8859-1\n"; 
     mail($to, $subject, $body, "From: james@mysite.com", $headers);

and it's just showing up as a text email like this:

Code:

<html><head><title>MySite Inventory</title></head><body><p>Current Inventory: 12 Home for the Holidays gift baskets left.</p><br/><br/>
<a href='http://www.mysite.com/index.php?app=ccp0&ns=prodshow&ref=christmas-gift-basket-home-for-the-holidays-008600'>
<img src='http://www.mysite.com/media/ccp0/prodlg/homeholidays08-300.jpg'/></a></body></html>

Anything stand out?

James...

Last edited by wyattea (11-15-2008 23:18:14)

Offline

 
  • Index
  •  » ClickCartPro 6
  •  » ADMIN SIDE - Email administrator when inventory level reaches Zero

Board footer