Home Integration Methods J2Store (Joomla! Extension)

J2Store (Joomla! Extension)

J2 Store is a simple shopping cart application for Joomla.This integration method integrates offline sales and sales processed by PayPal.
Offline sale
Open file plugins/j2store/payment_offline/payment_offline.php and find function _postPayment and this line within it:
        if ($orderpayment->save()) {

Add this code right above the line:
        $vars->order_id = $orderpayment->order_id;
        $vars->total_cost = $orderpayment->order_subtotal;

Save your work. Now open file plugins/j2store/payment_offline/payment_offline/tmpl/postpayment.php and add this code to the end of the file:
Save your work. This will create a pending commission for each offline transaction. You will have to approve or decline it manually later - based on the original transaction.
PayPal step 1
Find file plugins/j2store/payment_paypal/payment_paypal/tmpl/prepayment.php and find the notify_url input field. It looks something like this:
<input type="hidden" name="notify_url" value="<?php echo JRoute::_( $vars->notify_url ); ?>" />

and into that field add:

The updated field is supposed to look like this:
<input id='pap_ab78y5t4a' type="hidden" name="notify_url" value="<?php echo JRoute::_( $vars->notify_url ); ?>" />

Right under that notify_url input field (so right under that line of code) place this code below:

PayPal step 2
Open file plugins/j2store/payment_paypal/payment_paypal.php and find function _process() and this line within it:
$data = $app->input->getArray($_POST);

Now add this code below right above that line:

Do not forget to integrate you Joomla with the click tracking code and to activate the PayPal IPN Handling plugin in your installation of Post Affiliate Pro.