- Posts: 2
- Thank you received: 0
- Forum
- Support questions
- WooPrice Calculator (Pro)
- [SOLVED] Modifying woo-price-calculator.php - Cart and Checkout Variation output
×
WooPrice Calculator PRO
[SOLVED] Modifying woo-price-calculator.php - Cart and Checkout Variation output
- Josh Terrell
-
Topic Author
- Offline
Less
More
3 years 5 months ago - 3 years 5 months ago #357
by Josh Terrell
Josh Terrell replied the topic: Modifying woo-price-calculator.php - Cart and Checkout Variation output
I figured out my problem. I wasn't escaping the quotes. The following works:
and
$title[] = "<dt>{$label}</dt><dd>{$htmlElement}</dd>";
}
return "{$productTitle}<br/><dl class=\"uk-description-list\">" . implode("", $title) . "</dl>";
and
if($value === "on"){
return "<i class=\"fa fa-check-square-o fa-2x\"></i>";
}else{
return "<i class=\"fa fa-square-o fa-2x\"></i>";
}
Last Edit: 3 years 5 months ago by Josh Terrell.
Please Log in or Create an account to join the conversation.
- Josh Terrell
-
Topic Author
- Offline
Less
More
- Posts: 2
- Thank you received: 0
3 years 5 months ago - 3 years 5 months ago #356
by Josh Terrell
Josh Terrell created the topic: [SOLVED] Modifying woo-price-calculator.php - Cart and Checkout Variation output
Hello,
I want to clean up the way the variations are displayed in the Cart and the Checkout forms. I am trying to modify the following function:
Instead of breaks I want to use the following description list elements similar to the default Woocommerce variation list(but with UIKIT styling):
The problem is, whenever I attempt to use any HTML syntax with a class, I get an internal 500 error and the entire website will not load. I have the same problem when I try to replace the Check and X images with font awesome icons in the following lines:
I want to clean up the way the variations are displayed in the Cart and the Checkout forms. I am trying to modify the following function:
/*
* Eseguito in review-order.php per rivedere l'ordine
*/
/*WPC-PRO*/
function woocommerce_checkout_cart_item_quantity($productTitle, $cartItem){
if(isset($cartItem['simulator_id'])){
$simulatorId = $cartItem['simulator_id'];
if(!empty($simulatorId)){
$simulatorFieldsIds = $this->calculatorHelper->get_simulator_fields($simulatorId);
$simulatorFields = $this->fieldHelper->get_fields_by_ids($simulatorFieldsIds);
$simulatorFieldsData = $cartItem['simulator_fields_data'];
foreach($simulatorFields as $simulatorKey => $simulatorField){
$fieldId = $this->plugin_short_code . '_' . $simulatorField->id;
$label = $this->wsf->userTrans($simulatorField->label);
$value = $simulatorFieldsData[$fieldId];
$htmlElement = $this->getReviewElement($simulatorField, $value);
$title[] = "  <b>{$label}:</b> {$htmlElement}";
}
return "{$productTitle}<br/><small>" . implode("<br/>", $title) . "</small><br/>";
}else{
return $productTitle; // Nessuna modifica se non è un simulatore
}
}
}
Instead of breaks I want to use the following description list elements similar to the default Woocommerce variation list(but with UIKIT styling):
$title[] = "<dt>{$label}</dt><dd>{$htmlElement}</dd>";
}
return "{$productTitle}<br/><dl class="uk-description-list">" . implode("", $title) . "</dl>";
The problem is, whenever I attempt to use any HTML syntax with a class, I get an internal 500 error and the entire website will not load. I have the same problem when I try to replace the Check and X images with font awesome icons in the following lines:
public function getReviewElement($field, $value){
if($field->type == "checkbox"){
$tickImageUrl = $this->wsf->getImageUrl("tick.png");
$crossImageUrl = $this->wsf->getImageUrl("cross.png");
if($value === "on"){
return "<i class="fa fa-check-square-o fa-2x"></i>";
}else{
return "<i class="fa fa-square-o fa-2x"></i>";
}
Last Edit: 3 years 5 months ago by Josh Terrell.
Please Log in or Create an account to join the conversation.
Moderators: david
- Forum
- Support questions
- WooPrice Calculator (Pro)
- [SOLVED] Modifying woo-price-calculator.php - Cart and Checkout Variation output
Time to create page: 0.152 seconds