Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Compari.ro magazin de incredere. 
 
Alecs00
Member
 
Total Posts:  73
Joined:  2011-05-03
 

Salut,

Incerc sa implementez scriptul de la compari.ro “magazin de incredere” si m-am cam incurcat.

Ma poate ajuta cineva?

Atasat aveti toata documentatia ( 2 scripturi ) de la ei.

MS mult smile

Sample:

Compari.ro trusted shop program
 
Example code integration to the webshop
 

 *
 * 
Please notethat the example detailed below can not be simply copy-pasted
 
into your webshop’s codeit 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 engineGenerally 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 notmodify itYou 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).
 *
 ******************************************************************************
/
File Attachments
ak-trustedshop-php5-ro.zip  (File Size: 3KB - Downloads: 6)
ak-trustedshop-php5-ro.zip  (File Size: 3KB - Downloads: 5)
 
Magento Community Magento Community
Magento Community
Magento Community
 
emca
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2011-11-30
Bucharest
 

Te-ai uitat deja la asta: http://www.magento-romania.ro/feed-compari-ro.html ?

Daca nu, poate poti face un hook/observer ceva pe sales_order_place_after

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alecs00
Member
 
Total Posts:  73
Joined:  2011-05-03
 

Salut, si ms de raspuns emca,

Am adaugat in /public_html/app/code/core/Mage/Sales/Model/Order.php :

$cart Mage::getModel(\'sales/order\'); 
    
$email $cart->getCustomerEmail();
    
$products $cart->getAllItems();     
    
//$products = Mage::getModel(\'sales/order_item\')->getCollection();
     
foreach ($products as $item{
            $names[] 
$item->getName();
        
}
 
    
require_once \'TrustedShop.php\';

    try 
{
      
// Provide your own WebAPI key. You can find it on your partner portal.    
      
$Client = new TrustedShop(\'----------------------------------\');
      
$Client->SetEmail($email);
      foreach(
$names as $name{
        $Client
->AddProduct($name);
      
}
      $Client
->Send();
    
catch (Exception $Ex{
      $ErrorMessage 
$Ex->getMessage();
    
}

Ma poate ajuta cineva sa imi spuna daca codul este corect?, cel mai rau e ca nu pot testa.

Practic am nevoie de adresa e mail a clientului si de numele produselor comandate.

ms smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
emca
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2011-11-30
Bucharest
 

Nu editezi niciodata in code/core.  Eventual in code/local.
Citeste:
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method

de ce nu poti testa? nu ai apiKey ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alecs00
Member
 
Total Posts:  73
Joined:  2011-05-03
 

Salut si ms de raspuns, ( dupa ce termin cu modificarile am sa mut fisierul in \"local\"), Am apiKey, nu pot sa vad daca cei de la compari.ro primesc adresa de email si produsele comandate. ( suportul la ei lasa de dorit)

Oricum ms, nu ramane decat sa astept sa raspunda.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alecs00
Member
 
Total Posts:  73
Joined:  2011-05-03
 

Salut,
Am reuÈ™it sa implementez pana la urma programul “magazin de încredere” de la compari.ro
Postez în ideea ca ajuta pe cineva smile

Pas1:  public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php
public function successAction() {

}
comentam :  // $session->clear();
}
( sa putem da refresh la pagina “/checkout/onepage/success/ “ - pt teste )

Pas2: public_html/app/design/frontend/base/default/template/checkout/success.phtml ( sau in tema )
adaugaÈ›i :( nu uitaÈ›i sa adaugaÈ›i fiÈ™ierul ‘TrustedShop.php’ în acelaÈ™i folder )

<?php
/*******************************************************************************
     * compari.ro  trusted shop program
******************************************************************************/
$order = new Mage_Sales_Model_Order();
$incrementId Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order->loadByIncrementId($incrementId);

$email $order->getCustomerEmail();

$products $order->getAllItems();     
     foreach (
$products as $item{
         $names[] 
$item->getName();
        
}

    
require_once 'TrustedShop.php';

    try 
{
      
// Provide your own WebAPI key. You can find it on your partner portal.    
      
$Client = new TrustedShop('--apikey--');
      
$Client->SetEmail($email);
      foreach(
$names as $name{
        $Client
->AddProduct($name);
      
}
      $Client
->Send();
    
catch (Exception $Ex{
      $ErrorMessage 
$Ex->getMessage();
      
var_dump($ErrorMessage);
    
}
    
/*******************************************************************************
     * END: compari.ro  trusted shop program
******************************************************************************/
    
?>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top