Post by sezer1991 » Wed Dec 05, 2018 11:53 pm

Hi Community i need Help,

I am using open cart 2.2.0, have signed up as merchant at adcell, would like to offer affiliate links from my website to other website operators.

I got the following code from Adcell:

Code: Select all

<?php if (isset ($_SESSION['customer_order_success'])) { ?>

<script type="text/javascript" src="https://t.adcell.com/t/track.js??pid=6934&eventid=8858&referenz=<?php echo $_SESSION['customer_order_success']; ?>&betrag=<?php echo $_SESSION['customer_order_net_amount']; ?>"></script>

<noscript>

<img src="https://t.adcell.com/t/track?pid=6934&eventid=8858&referenz=<?php echo $_SESSION['customer_order_success']; ?>&betrag=<?php echo $_SESSION['customer_order_net_amount']; ?>" border="0" width="1" height="1">

</noscript>

<?php unset($_SESSION['customer_order_success']); ?>

<?php unset($_SESSION['customer_order_net_amount']); ?>

or as an alternative, I should use this:

Code: Select all

<script type="text/javascript" src="https://t.adcell.com/t/track.js?pid=6934&eventid=8858&referenz=ABC_123&betrag=123.45">
</script>
<noscript>
<img border="0" width="1" height="1" src="https://t.adcell.com/t/track?pid=6934&eventid=8858&referenz=ABC_123&betrag=123.45">
</noscript>
I should insert that at sucess.php but then the error message comes:
Parse error: syntax error, unexpected '<' in /homepages/1/d732249520/htdocs/catalog/language/en-gb/checkout/success.php on line 12
I used two different sucess file paths:

/catalog/language/de-DE/checkout/

/catalog/controller/de-DE/checkout/


Of course, I changed the change synonymous with other languages ​​sucess.php with but nothing brings.

Newbie

Posts

Joined
Wed Dec 05, 2018 11:43 pm

Post by OSWorX » Thu Dec 06, 2018 12:04 am

You should not add the code inside the language files!
Instead the template (e.g. success.tpl).

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by sezer1991 » Thu Dec 06, 2018 12:08 am

wow thanx for this fast answer,

but i dont have sucess.tpl
i looks under my default template : /catalog/view/theme/default/template/checkout/

but no sucess.tpl

only confirm.tpl i tested with this but dont work

plz help me :(

Newbie

Posts

Joined
Wed Dec 05, 2018 11:43 pm

Post by OSWorX » Thu Dec 06, 2018 2:22 am

Code: Select all

../catalog/view/theme/*/template/common/success.tpl
* = ersetzen mit Vorlagenname z.B. default

Plus: die im Code oben verwendeten Variablen müssen im Controller gesetzt werden:

Code: Select all

../catalog/controller/common/success.php
Oder besser gleich im Controller den gesamten Code generieren und als einzelne Variable z.B. $data['adcell'] definieren und nur diese dann in der Vorlage aufrufen.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by sezer1991 » Thu Dec 06, 2018 2:56 am

Super kannst deutsch :)

ich habe leider keine Datei sucess.php in ../catalog/controller/common/
und was genau soll man ändern ?

ich habe diesen code hier :

Code: Select all

<?php if (isset ($_SESSION['customer_order_success'])) { ?>

<script type="text/javascript" src="https://t.adcell.com/t/track.js??pid=6934&eventid=8858&referenz=<?php echo $_SESSION['customer_order_success']; ?>&betrag=<?php echo $_SESSION['customer_order_net_amount']; ?>"></script>

<noscript>

<img src="https://t.adcell.com/t/track?pid=6934&eventid=8858&referenz=<?php echo $_SESSION['customer_order_success']; ?>&betrag=<?php echo $_SESSION['customer_order_net_amount']; ?>" border="0" width="1" height="1">

</noscript>

<?php unset($_SESSION['customer_order_success']); ?>

<?php unset($_SESSION['customer_order_net_amount']); ?>
unter ../catalog/view/theme/*/template/common/success.tpl

hinzugefügt natürlich bekomme ich fehler code :

Code: Select all

Parse error: syntax error, unexpected end of file in /homepages/1/d732249520/htdocs/catalog/view/theme/tt_domino1/template/common/success.tpl on line 48

Newbie

Posts

Joined
Wed Dec 05, 2018 11:43 pm

Post by OSWorX » Thu Dec 06, 2018 4:05 am

sezer1991 wrote:
Thu Dec 06, 2018 2:56 am
Super kannst deutsch :)
Of course.
Forgot that we are in the English spoken forum (more German in the German speaking forum).
From what I see, you will never get the output you need.
Better to hire a developer, you can contact me either via Email or PM.

The file is (sorrry my fault!):

Code: Select all

../catalog/controller/checkout/sucess.php
But you should find it also by yourself if you read the code.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by ocmta » Thu Dec 06, 2018 4:54 am

Here is what you should do:

1. Edit file catalog/controller/checkout/success.php. Find this:

Code: Select all

if (isset($this->session->data['order_id'])) {
and right below add this:

Code: Select all

$this->load->model('checkout/order');
$o = $this->model_checkout_order->getOrder($this->session->data['order_id']);
if($o) {
	$data['adcell'] = array(
		'order_id' => $o['order_id'],
		'total' => $o['total']
	);
}
2. Edit file catalog/view/theme/<your theme>/template/common/success.tpl (replace <your theme> with actual theme directory) . Find this:

Code: Select all

<?php echo $footer; ?>
and right above add this:

Code: Select all

<?php if (isset($adcell)) { ?>
<script type="text/javascript" src="https://t.adcell.com/t/track.js?pid=6934&eventid=8858&referenz=<?php echo $adcell['order_id']; ?>&betrag=<?php echo $adcell['total']; ?>"></script>
<noscript>
<img src="https://t.adcell.com/t/track?pid=6934&eventid=8858&referenz=<?php echo $adcell['order_id']; ?>&betrag=<?php echo $adcell['total']; ?>" border="0" width="1" height="1">
</noscript>
<?php } ?>

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am

Who is online

Users browsing this forum: No registered users and 5 guests