• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

shopping cart widget. Help please!

New Here ,
May 21, 2020 May 21, 2020

Copy link to clipboard

Copied

I bought a shopping cart widget for muse. To send orders to my email, you need to insert the code somewhere, but I don't understand where. Help please!
this code:

 
<?php
 
$adminEmail = ‘email’; // почта владельца магазина
$siteName = ‘name’; // название магазина
$siteEmail = ‘email2’; // эл. почта магазина
 
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$delivery = $_POST['delivery'];
$address = $_POST['address'];
$comment = $_POST['comment'];
$checkoutList = $_POST['checkoutList'];
$total = $_POST['total'];
$currency = $_POST['currency'];
$orderId = $_POST['orderId'];
 
$checkoutListArr = explode('>>>>', $checkoutList);
foreach($checkoutListArr as $key => $str) {
    $checkoutListArr[$key] = explode('>>', $str);
}
$checkoutListTable = [];
foreach($checkoutListArr as $key => $str) {
    array_push($checkoutListTable, "<tr><td>$str[1]</td><td>$str[2] $currency</td><td>x$str[3]</td><td>$str[4] $currency</td></tr>");
}
$checkoutListTable = implode($checkoutListTable);
 
$headers  = "Content-type: text/html; charset=utf-8\r\n";
$headers .= "From: ".$siteName."<".$siteEmail.">\r\n";
 
$adminMessage = '<html><body>';
$adminMessage .= "<p>Имя: $name</p>";
$adminMessage .= "<p>Эл. почта: $email</p>";
$adminMessage .= "<p>Телефон: $phone</p>";
$adminMessage .= "<p>Доставка: $delivery</p>";
$adminMessage .= "<p>Адрес: $address</p>";
$adminMessage .= "<p>Коментарий: $comment</p>";
$adminMessage .= "<table><tbody>";
$adminMessage .= "$checkoutListTable";
$adminMessage .= "</tbody></table>";
$adminMessage .= "<p>Итого: $total $currency</p>";
$adminMessage .= "</body></html>";
 
$userMessage = '<html><body>';
$userMessage .= "<p>Доставка: $delivery</p>";
$userMessage .= "<table><tbody>";
$userMessage .= "$checkoutListTable";
$userMessage .= "</tbody></table>";
$userMessage .= "<p>Итого: $total $currency</p>";
$userMessage .= "</body></html>";
 
if (isset($checkoutList)) {
    mail($adminEmail, 'Заказ №'.$orderId, $adminMessage, $headers);
    mail($email, 'Заказ №'.$orderId, $userMessage, $headers);
}
 
?>

Views

297

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2020 May 22, 2020

Copy link to clipboard

Copied

This is impossible to do in Muse. Muse does not support server-side code.

 

Your PHP script needs to be combined with a form and saved in a .php file. 

Consult the documentation that came with your PHP script. Or contact whomever sold you the script.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 27, 2020 May 27, 2020

Copy link to clipboard

Copied

I also tried to open the code, but failed. Then I did not know that the code is not supported.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 28, 2020 May 28, 2020

Copy link to clipboard

Copied

LATEST

It does not seem to be a widget for muse but for any "normal" website editor, I guess. It might be a shopping cart widget but muse widget had never been in need to fill in any code snippet as far as I experienced.

 

Kind Regards,

Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines