Jump to content
Sign in to follow this  
Zolko78

[Rezolvat] Modul print label (Mandat Postal)

Recommended Posts

Salutare tuturor

Sunt incepator in php. Am facut mici modificari la modulul printlabel. Problema mea este ca nu stiu cum sa afisez numele judetului in loc de id_state.

<?php
require ('../../tools/fpdf/fpdf.php');
//download-label.php?id_order=

//define('PS_ADMIN_DIR', getcwd());
include('../../config/config.inc.php');

if ($_GET["token"] != md5(Configuration::get('EXPINET_TOKEN')))
Tools::redirect('../..'.urldecode($_GET["adminfolder"]).'login.php');


if(intval($_GET["id_order"]) > 0) {
$order = new Order(intval($_GET["id_order"]));
$customer = new Customer($order->id_customer);
$ad = new Address(intval($order->id_address_delivery));
$products = $order->getProducts();
$entreprise=$ad->company;
$nom=$ad->firstname;
$prenom=$ad->lastname;
$champadresse1=$ad->address1;
$champadresse2=$ad->address2;
$codepostal=$ad->postcode;
$ville=$ad->city;
$mobtel=$ad->phone_mobile;
$state=$ad->id_state;
//$id_lang=$ad->id_lang;
$country=$ad->country;
$police=Configuration::get('POLICE');
?>

22186_KnpF6RaU0xRALZ164UDQ_t

download-label.php

Share this post


Link to post
Share on other sites

Da, am introdus judetele, dar nu am reusit decat sa apare id-ul judetului. Nu stiu cum sa fac referinta la denumirea judetului. (Am incercat cu state, states, dar nu merge) Are cineva vreo idee?

Share this post


Link to post
Share on other sites

Am incercat si cu "name", dar nici asta nu functioneaza. Ce mi se pare interesant ca pentru tara accepta "country"

Share this post


Link to post
Share on other sites

Am reusit sa identific problema inspirand de la un topic italian

La denumirea judetului se poate face referinta cu:
" $deliverystate = $ad->id_state ? new State($ad->id_state) : false; "

Am atasat modulul modificat. Personalizarea se face prin editarea download-label.php, si schimbarea X-urilor.

22246_PJsbUM2QBzkM6mAHc3BJ_t

printlabel modificat.zip

Share this post


Link to post
Share on other sites
Sign in to follow this  

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More