Felhasználóbarát PHP alapú bevásárlókosár rendszer.
A ZenCart-tal való integráció az eladáskövető szkript elhelyezésével történik a rendelés-visszaigazoló oldalon.
Sablon szerkesztése
A ZenCart integrálásához szerkessze a rendelés-visszaigazoló sablont. Nyissa meg a fájlt includes/templates/template_default/templates/tpl_checkout_success_default.php.
Keresse meg az integrációs helyet
Keresse meg a következő kóddal rendelkező sort, amelynek már léteznie kell a fájlban.
<div id="checkoutSuccessOrderNumber"><?php echo TEXT_YOUR_ORDER_NUMBER . $zv_orders_id; ?></div>
Integráció
Másolja ki és illessze be a következő kódot a fájlba, a fenti sor alá:
<?php
$dbreq = $db->Execute("select * from ".TABLE_ORDERS_TOTAL." where orders_id = '".(int)$orders->fields['orders_id']."' AND class in ('ot_coupon', 'ot_gv', 'ot_subtotal', 'ot_group_pricing', 'ot_quantity_discount')");
while (!$dbreq->EOF) {
switch ($dbreq->fields['class']) {
case 'ot_subtotal': $order_subtotal = $dbreq->fields['value']; break;
case 'ot_coupon': $coupon_amount = $dbreq->fields['value']; $coupon_code = $dbreq->fields['title']; break;
case 'ot_group_pricing': $group_pricing_amount = $dbreq->fields['value']; break;
case 'ot_gv': $gv_amount = $dbreq->fields['value']; break;
case 'ot_quantity_discount': $quantity_discount_amount = $dbreq->fields['value']; break;
}
$dbreq->MoveNext();
}
$totalCost = ($order_subtotal - $gv_amount - $coupon_amount - $group_pricing_amount - $quantity_discount_amount);
$totalCost = number_format($totalCost,2,'.','');
$orderId = $dbreq->fields['orders_id'];
// ------------- coupon code --------------------------------------------------
$coupon_code = substr($coupon_code,(strpos($coupon_code,":"))+2);
$coupon_code = substr($coupon_code,0,strlen($coupon_code)-2);
// -------------products---------------------------------------------------------
$productId = "";
$dbreqa = $db->Execute("select products_id from ".TABLE_ORDERS_PRODUCTS." where orders_id = '".(int)$orders->fields['orders_id']."' ");
while (!$dbreqa->EOF) {
$productId = $dbreqa->fields['products_id'];
$dbreqa->MoveNext();
}
// ----------end products--------------------------------------------------------
print '<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">';
print "PostAffTracker.setAccountId('Account_ID');";
print 'var sale = PostAffTracker.createSale();
sale.setTotalCost(\''.$totalCost.'\');
sale.setOrderID(\''.$orderId.'\');
sale.setProductID(\''.$productId.'\');
sale.setCoupon(\''.$coupon_code.'\');
PostAffTracker.register();
</script>';
?>
Rendben, az integráció befejeződött. Mostantól minden eladáskor az üzlet előhívja a forgatókönyvünket, és regisztrálja az eladási jutalékot.
Élettartamra szóló jutalékok integrációja
Ha integrálni szeretné a Lifetime Commissions beépülő modult, akkor egyszerűen adja hozzá az alábbi kódot a kódhoz a 3. lépéstől kezdve, ez után a sor után:
$orderId = $dbreq->fields['orders_id'];
$dbreq = $db->Execute("select * from ".TABLE_ORDERS_TOTAL." where orders_id = '".(int)$orders->fields['orders_id']."' ");
while (!$dbreq->EOF) {
$email = $dbreq->fields['customers_email_address'];
$dbreq->MoveNext();
}
Ezt a kódot is hozzá kell adnia:
sale.setData1(\''.$email.'\');
közvetlenül ezután:
sale.setOrderID(\''.$orderId.'\');
Ha tudni szeretné a megrendelésben használt fizetési mód nevét, akkor ezt a változót használhatja:
$orders->fields['payment_method']
zenCart + PayPal – 1. rész
Ha a PayPal-t használja fizetési átjáróként a ZenCartban, akkor másfajta integrációs megközelítésre van szükség.
A ‘zenCart_installation_directory/includes/functions/html_output.php’ mappában keresse meg a következő sort:
$field = '<input type="hidden" name="' . zen_sanitize_string(zen_output_string($name)) . '"';
és cserélje ki erre:
if ($name == 'notify_url') {
$field = '<input type="hidden" id="pap_ab78y5t4a" name="' . zen_output_string($name) . '"';
} else {
$field = '<input type="hidden" name="' . zen_output_string($name) . '"';
}
zenCart + PayPal – 2. rész
A ‘zenCart_installation_directory/includes/templates/template_default/common/tpl_footer.php’ mappába adja hozzá a következő kódot:
<!-- PAP Integration snippet -->
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('default1');
PostAffTracker.writeCookieToCustomField('pap_ab78y5t4a', '', 'pap_custom');
</script>
<!-- /PAP Integration snippet -->
zenCart + PayPal – 3. rész
A ‘zenCart_installation_directory/ipn_main_handler.php’ mappába adja hozzá a következő kódot:
/* Post Affiliate Pro integration snippet */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://URL_TO_PostAffiliatePro/plugins/PayPal/paypal.php?pap_custom=".$_GET['pap_custom']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_exec($ch);
/* /Post Affiliate Pro integration snippet */
Ennyi.
Most jelentkezzen be a Post Affiliate Pro (Network) kereskedői paneljére, keresse meg a „Plugins” részt, és aktiválja a „PayPal IPN Handling” beépülő modult.
MEGJEGYZÉS: Ha engedélyezni szeretné a Lifetime Commission integrációt a „zenCart + PayPal” integrációs módszer használatakor, akkor a „PayPal IPN Handling” beépülő modul konfigurációjában kapcsolja be az „Élettartamú jutalék támogatása” opciót.
Ne felejtse el integrálni webhelyét a kattintáskövető kóddal, hogy az eladáskövetés megfelelően működjön.
The article discusses the availability and partnership opportunities of Post Affiliate Pro, a software for affiliate marketing. It includes instructions on integrating the software with XtCommerce and snippets for tracking sales. The article concludes with links to related resources and an invitation to create a free account.
The text explores various integration options for tracking sales and products on e-commerce websites using Post Affiliate Pro. It discusses integrations with platforms such as Cart66 and SquirrelCart, as well as payment processing options like Dwolla. The ViArt CMS is also mentioned as an option for tracking sales using specific variables. The text provides instructions for integration with osc2nuke, including code snippets to add to a website's checkout page. The benefits of using Iono and eCartSoft for customer service and billing are also highlighted. The text emphasizes the importance of ROI and covers related concepts like CSV files and CPM in internet advertising. Overall, the text encourages readers to create a free account with Post Affiliate Pro for tracking sales and managing their e-commerce business efficiently.