Cronjob for price alarm

Hi there,

is it possible to execute the sending of price alarms via cronjob?

In the admin interface you can send it by

<a href="https://yourshop.com/admin/index.php?editlanguage=0&force_admin_sid=foo123&stoken=baar5C&&cl=pricealarm_send" class="edittext" target="list"><b>click here.</b></a>

Anybody an idea to integrate that function into a script?

I have found this as starting point in the german forum, but i have no idea hot to adapt it for price alarm:


<?
//change this
$sOxidConfigDir = "/htdocs/oxideshop/eshop/source/";

//init framework
function getShopBasePath()
{
    global $sOxidConfigDir;
    return $sOxidConfigDir . "/";
}
require_once(getShopBasePath(). "/core/oxfunctions.php");

//update price alarm 

Best Regards
Tecki

here is the code that sends price alerts:
http://docu.oxid-esales.com/CE/sourcecodedocumentation/4.10.5/pricealarm__send_8php_source.html#l00105

you will need to load active price alerts (like in row 36) you want to send and use a foreach loop for iteration

Thx for your reply marat -
but i must confess my understanding is way to limited to get this to work
and yes, i know it is a layer8 problem

i have tried to call the function via
$sendmail = new PriceAlarm_Send;
$sendmail->sendeMail();

but i get a Internal Server Error

$oPriceAlarm_Send = oxNew("pricealarm_send");
$issent = $oPriceAlarm_Send->sendeMail(...)

thx rubbercut,
but i still get internal server error

what is supposed to be in the brackets instead of "…"
sendeMail(…)

don’t laugh at me, i am a noob at this i know

Example:

$issent = $oPriceAlarm_Send->sendeMail(
                        $rs->fields['oxemail'],
                        $rs->fields['oxartid'],
                        $rs->fields['oxid'],
                        $rs->fields['oxprice']
                    )

still 500 Internal Server Error

current file:

 <?
//change this
$sOxidConfigDir = "/www/htdocs/[some Domain]";

//init framework
function getShopBasePath()
{
    global $sOxidConfigDir;
    return $sOxidConfigDir . "/";
}
require_once(getShopBasePath(). "/core/oxfunctions.php");

//send price alarm mail
$oPriceAlarm_Send = oxNew("pricealarm_send");
$issent = $oPriceAlarm_Send->sendeMail(
                        $rs->fields['oxemail'],
                        $rs->fields['oxartid'],
                        $rs->fields['oxid'],
                        $rs->fields['oxprice']
                    ); 

You can not be serious :confused: It was just an example for variables that are needed from a loop.

i have stated the expert lvl 3 times in this thread :D:(:o:o

[QUOTE=Tecki;189964]i have stated the expert lvl 3 times in this thread :D:(:o:o[/QUOTE]

Then you have to acquire appropriate basic knowledge.

Two advices: Error 500. The following might fix the error in this case:

require_once( getShopBasePath()."bootstrap.php");
require_once( getShopBasePath()."core/oxsupercfg.php");
require_once( getShopBasePath()."core/oxfunctions.php");
require_once( getShopBasePath()."core/oxconfig.php");
$oPriceAlarm_Send = oxNew("pricealarm_send");
$issent = $oPriceAlarm_Send->sendeMail(
	'[email protected]', // $sEMail
	'05848170643ab0deb9914566391c0c63', // $sProductID
	'068b873c673a551c178eac015dfe2320', //$sPricealarmID -> oxid table oxpricealarm
	'3.50' //$sBidPrice
);