Jump to content
#StayAtHome ×

Search the Community

Showing results for tags 'prestashop'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, I am not a coder, but I have this issue with my ecommerce platform which is based on Prestashop. So could You please explain to me what is the purpose of this php script below? Whap is gonna to happen if I delete it (this script is giving me an error)? <?php $host = "http://localhost:8080"; $company = "BlueSky"; $email = "lisa.penvenen@gmail.com"; $price = "1000"; $offerNumber = "958"; $description = "My invoice"; $street = "Baker street 221B"; $city = "London"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERPWD, "lisa.penvenen:mypass"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HTTPAUTH, TRUE); $id = send($ch, $host, $company, $description, $price, $offerNumber, $street, $city); sendEmail($ch, $host, $company, $id, $email); curl_close($ch); function send($ch, $host, $company, $description, $price, $offerNumber, $street, $city) { curl_setopt($ch, CURLOPT_URL, $host . "/c/" . $company . "/invoice-issued.json"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); $invoice = array( "winstrom" => array( "invoice-issued" => array( "documentType" => "code:INVOICE", "mine" => "code:WINSTROM", "description" => $popis, "total" => $price, "noItems" => "true", "offerNumber" => $offerNumber, "street" => $ulice, "city" => $mesto, ) ) ); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($invoice)); $output = curl_exec($ch); if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200 && curl_getinfo($ch, CURLINFO_HTTP_CODE) != 201) { printf("Error occurred during the operation (HTTP %d): %sn", curl_getinfo($ch, CURLINFO_HTTP_CODE), $output); } else { $id = get_id($output); printf("Success (1) s ID: %s <br/>", $id); return $id; } } function get_id($output) { $id = 0; $jsonIterator = new RecursiveIteratorIterator( new RecursiveArrayIterator(json_decode($output, TRUE)), RecursiveIteratorIterator::SELF_FIRST); foreach ($jsonIterator as $key => $val) { if (!is_array($val)) { if ('id' == $key) { $id = $val; } } } return $id; } function sendEmail($ch, $host, $company, $id, $email) { curl_setopt($ch, CURLOPT_URL, $host . "/c/" . $company . "/invoice-issued/" . $id . "/sending-documents.xml"); curl_setopt($ch, CURLOPT_POSTFIELDS, "to=" . $email . "&subject=Invoice"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); $output = curl_exec($ch); if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200 && curl_getinfo($ch, CURLINFO_HTTP_CODE) != 201) { printf("rror occurred during the operation (HTTP %d): %sn", curl_getinfo($ch, CURLINFO_HTTP_CODE), $output); } else { printf("Success (2)"); } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.