11.04.2022 14:12
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
php shell exec after success full payment
So I need to exec php code with freeattrval freeattribute from the product and buyers userid or username..
I have created a plugin with this code:
defined('_JEXEC') or die('Restricted access');
jimport('joomla.plugin.plugin');
class plgJshoppingcheckoutTrackers_checkout extends JPlugin{
function __construct(&$subject, $config){
parent::__construct($subject, $config);
}
function onEndCheckoutStep5(&$order){
}
function onAfterChangeOrderStatus(&$order_id, &$status, &$sendmessage){
print "okoktest";die();
}
function onAfterChangeOrderStatusAdmin(&$order_id, &$order_status, &$status_id, &$notify, &$comments, &$include, &$view_order){
}
}
endcode: it stops after payment but how to validate payment successfull and get freeattribute from order and userid or username?
I need those variables from my external registeration process.
|
|
11.04.2022 21:39
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
this to middle function got me user_id for the order but I tryed the get username from user / users db but no luck any help?
$jshopConfig = &\JSFactory::getConfig();
$_order_id = \JSFactory::getTable('product', 'jshop');
$_order_id->load($order_id);
$_orders_id = \JSFactory::getTable('order', 'jshop');
$_orders_id->load($order_id);
print "<br>user id";
$user_id= $_orders_id->{'user_id'};
print $user_id;
$_username2 = \JSFactory::getTable('user', 'jshop');
$_username2->load($user_id);
$_username = $_username2->{'f_name'};
print "<br>";
print $_username;
|
|
11.04.2022 23:38
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
$_orders_id = \JSFactory::getTable('order', 'jshop');
$_orders_id->load($order_id);
print "<br>user id= ";
$user_id= $_orders_id->{'user_id'};
print $user_id;
print "<br>order number= ";
$order_number= $_orders_id->{'order_number'};
print $order_number;
print "<br>Nimi= ";
$db = JFactory::getDBO();
$query = "select f_name from #__jshopping_users where user_id = $user_id";
$db->setQuery($query);
$etunimi= $db->loadResult();
print $etunimi;
print " ";
$query = "select l_name from #__jshopping_users where user_id = $user_id";
$db->setQuery($query);
$sukunimi= $db->loadResult();
print $sukunimi;
print "<br>order_id= ";
print $order_id;
print "<br>";
currently I can get all other but how to get freeattribute variable for the product's in order
|
|
11.04.2022 23:47
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
when does this function execute.. I ordered via pm_test no no execution...
function onAfterChangeOrderStatusAdmin(&$order_id, &$order_status, &$status_id, &$notify, &$comments, &$include, &$view_order)
|
|
12.04.2022 01:15
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
i got it :)
|
|
12.04.2022 19:44
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25955
|
Aw: php shell exec after success full payment
$order = JSFactory::getTable('order', 'jshop');
$order->load($order_id);
$order_items = $order->getAllItems();
print_r($order_items)
|
|
15.04.2022 03:33
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
another questions
I have this function in free attribute validation
public function onBeforeAddProductToCart(&$cart, &$product_id, &$quantity, &$attr_id, &$freeattributes, &$updateqty, &$product_name)
is there a way to check witch attributes are selected?
not freeattributes
|
|
15.04.2022 16:47
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25955
|
Aw: php shell exec after success full payment
See array $attr_id,
|
|
15.04.2022 20:18
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
thanks, I got that now need to get language used in purchase...
how to do that?
|
|
15.04.2022 20:34
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25955
|
Aw: php shell exec after success full payment
$order = JSFactory::getTable('order', 'jshop');
$order->load($order_id);
$lang = $order->getLang();
|
|
16.04.2022 01:18
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
thanks,
Still need to add information to jshopping_users db.. I added field to the table for this information.
How can I add $variable to jshopping_users from this function
function onAfterChangeOrderStatus(&$order_id, &$status, &$sendmessage){
and what is the best command for reading the variable from table...
|
|
16.04.2022 06:51
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
got all that database stuff working...
I have 1 attribute that needs 4 free attributes entered when selected is that done via template or?
Последнее изменение: 16.04.2022 06:55
|
|
16.04.2022 13:27
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
Think all I need is this pugin to be updated to joomshopping 5.x joomla 4.x
Display Free attributes for Attributes
and then I''ll buy it...
|
|
16.04.2022 13:36
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
and how can I replace "no image" image :)
|
|
16.04.2022 16:29
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25955
|
Aw: php shell exec after success full payment
tracker2 - 16.04.2022 13:27
Think all I need is this pugin to be updated to joomshopping 5.x joomla 4.x
Display Free attributes for Attributes
and then I''ll buy it...
New version:
Display Free attributes for Attributes 2.0.6
|
|
16.04.2022 16:30
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25955
|
Aw: php shell exec after success full payment
tracker2 - 16.04.2022 13:36
and how can I replace "no image" image :)
I did not understand the question?
|
|
16.04.2022 20:22
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
when product has no image.. the frontend shows square with text no image.. can I replace that somehow?
|
|
16.04.2022 22:01
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Сообщения: 25955
|
Aw: php shell exec after success full payment
Yes.
Change image.
|
|
17.04.2022 00:12
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
new version off display free attributes broke my admin interface view for attributes after installing it I got blank attributes page before there where about 8 attributes shown.. for product..
didnt find anywhere to select freeattribute for attribute.. so it does not work..
|
|
17.04.2022 00:25
|
|
tracker2
Name: Janne Leppänen
06.04.2022
Сообщения: 64
|
Aw: php shell exec after success full payment
got it back for backup and update now attributes are shown as normal but addon installation didnt do anything where is the place to select free attribute for attribute
|
|