Post by bravoshop » Fri Sep 18, 2015 9:52 pm

Va salut, din nou ! :)

As dori daca se poate, putin ajutor in implementarea scriptului trustedshop de la compari
Am modificat codul, asa :

Code: Select all

<?php

/*******************************************************************************
 * Compari.ro trusted shop program
 * Example code integration to the webshop
 * 
 *
 * Please note, that the example detailed below can not be simply copy-pasted
 * into your webshop’s code, it has to be customized adequately.
 *
 * Setup steps:
 * 1. Copy TrustedShop.php file to a place accessible by the webshop engine.
 * 2. Copy this example code to the page of the webshop where the e-mail address
 *    of the customer and the names of the purchased products are retrievable
 *    from the webshop engine. Generally this is the webshop’s confirmation
 *    page of the purchase.
 * 3. Customize the pasted example code according to the following:
 *    - Modify path of TrustedShop.php in require_once() in such a way that
 *      the webshop engine can use it.
 *    - Check that the proper WebAPI key is set, if not, modify it. You can find
 *      the WebAPI key on the partner portal.
 *    - Set the customer’s e-mail address.
 *    - Add the names of the purchased products.
 *    - Implement an error handling if you want (optional).
 *
 ******************************************************************************/

require_once 'TrustedShop.php';

try {
  
  // Provide your own WebAPI key.
  // You can find your WebAPI key on your partner portal.
  
  $Client = new TrustedShop('39061b4fd663aa95d02c5a2741cf09da');
  
  // Provide the e-mail address of your customer.
  // You can retrieve the e-amil address from the webshop engine.
  
  $Client->SetEmail('$email');

  // Provide the name of the purchased products.
  // You can get the name of the products from the webshop engine.
  // The AddProduct method must be called for each of the purchased products.
  // 
  // It is optional to provide the name of the products, so if this data is not
  // available, you can leave out the AddProduct calls.
  
  $Client->AddProduct('$product['name']');
  $Client->AddProduct('$product['name']');

  // This method sends us the e-mail address and the name of the purchased
  // products set above. After the data arrived to us, we store them
  // with the time stamp and the WebAPI key.
  // This lets us know that someone has purchased at your webshop, to whom
  // we later have to send the questionnaire for evaluating your shop.
  // The "Send()" operation doesn't send immediately. It generates a HTML output, 
  // puts into source of the page and the customer's browser will send the 
  // required informations us.
  
  $Client->Send();
  
} catch (Exception $Ex) {
  
  // Here you can implement error handling. The error message can be obtained
  // in the manner shown below. Implementing error handling is optional.
  
  $ErrorMessage = $Ex->getMessage();
}

?>
Dar nu stiu daca e bine, adica, sigur nu e bine, pentru ca la primesc eroare la $Client->AddProduct('$product['name']');

Tin sa precizez ca l-am implementat in footer sau in success.php dar nu primesc nici`un email.

Daca poate cineva sa faca un tutorial, mai mura-n gura asa..cum trebuie completat, unde trebuie inserat si unde trebuie uploadat trustedshop.php ca sa-l citeasca codul.

New member

Posts

Joined
Mon Sep 07, 2015 1:52 pm

Post by opencartromania » Fri Sep 18, 2015 10:02 pm

Salutare!

Mai bine faceti o lista cu cerintele dvs. poate se gaseste cineva sa va completeze.

Problema acelui script este:

calea catre fisierul: TrustedShop.php

eu as face ceva de genu:

1. copiezi fisieru mai sus amintit in public_html

2. editezi cu:

Code: Select all

require_once . DIR_APPLICATION . 'TrustedShop.php';
Succes :)

User avatar
Active Member

Posts

Joined
Wed Sep 25, 2013 9:26 pm


Post by bravoshop » Fri Sep 18, 2015 10:09 pm

Multumesc. Si, scriptul il implementez in footer sau succes ? Conteaza ?

New member

Posts

Joined
Mon Sep 07, 2015 1:52 pm

Post by opencartromania » Sat Sep 19, 2015 10:48 pm

Salutare!
This method sends us the e-mail address and the name of the purchased
// products set above. After the data arrived to us, we store them
// with the time stamp and the WebAPI key.
// This lets us know that someone has purchased at your webshop, to whom
// we later have to send the questionnaire for evaluating your shop.
// The "Send()" operation doesn't send immediately. It generates a HTML output,
// puts into source of the page and the customer's browser will send the
// required informations us.
Read up .. so nici unu nici altul :)

Informatiile le gasesti in controller/checkout/confirm.php

Nu cred ca ai avea vreo sansa sa poti implementa asa ceva de unul singur... dar cine stie.

Succes!

User avatar
Active Member

Posts

Joined
Wed Sep 25, 2013 9:26 pm


Post by inactiveaccount9912 » Tue Sep 22, 2015 2:02 am

ce face asta mai exact?

Poate ar trebuii mai degraba pus in checkout/success.php.

Am o nelamurire:

Code: Select all

$Client->Send();
zice ca:
// The "Send()" operation doesn't send immediately. It generates a HTML output,
// puts into source of the page and the customer's browser will send the
// required informations us.
Adica face direct output in controller?

Pentru ca in acest caz, acel cod ar trebuii executat in tpl, si in controller sa se lucreze cu Client asa:

Code: Select all

$data['Client'] = new TrustedShop('39061b4fd663aa95d02c5a2741cf09da');
$data['Client']->SetEmail('$email');
$data['Client']->AddProduct('$product['name']');

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by opencartromania » Tue Sep 22, 2015 2:28 am

Saluare!

Din pacate nu prea mai are acele informatii in succes (controller sau tpl)

Cele bune!

User avatar
Active Member

Posts

Joined
Wed Sep 25, 2013 9:26 pm


Post by inactiveaccount9912 » Tue Sep 22, 2015 5:10 pm

Se pot prelua usor, si acolo ar trebuii adaugat pentru corectitudine, la confirm ajung multi, banuiesc ca e important cine finalizeaza comanda, in success.php imediat sub linia:

Code: Select all

if (isset($this->session->data['order_id'])) {
poate prelua informatiile comenzii din baza de date pe baza acelui order_id inainte sa fie sters.

Expert Member

Posts

Joined
Fri May 14, 2010 2:36 am

Post by opencartromania » Tue Sep 22, 2015 6:13 pm

Salutare!

Dap, cu extracod.

Cine doreste acest modul. il rog sa ma contacteze.

Modulul este contracost.

Cele bune!
ps: au venit mai multe cerinte pe aceasta tema.

User avatar
Active Member

Posts

Joined
Wed Sep 25, 2013 9:26 pm


Post by MaHmur » Fri Nov 06, 2015 6:50 pm

Am reusit eu sa implementez si functioneaza (am cerut lista de email transmise de la compari.ro). Cine are nevoie de ajutor poate sa apeleze.

Image


New member

Posts

Joined
Thu Mar 13, 2014 6:16 pm
Location - Bucuresti

Post by mitza.dragan » Thu Jun 08, 2017 10:18 pm

Salut.
Cine ma poate ajuta cu implementarea programului Magazin de incredere de la compari, pentru versiunea 2.1.0.1. ?
Va multumesc.

Newbie

Posts

Joined
Wed Jun 07, 2017 2:00 pm
Who is online

Users browsing this forum: No registered users and 218 guests