Skip to content

Commit

Permalink
improvement: Add obscurity for product name, description and image
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuellopess committed May 3, 2024
1 parent 1b382e6 commit e9347b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public function get_items_build_array() {
foreach ( $this->order->get_items() as $item ) {
if ( $item['qty'] ) {
$product = wc_get_product( $item['product_id'] );
// TODO Maybe add option to activate or deactivate anonymous products
// TODO Here is product name for transaction
$product_title = "Product";
$product_content = "";
$product_image = plugins_url( '../../assets/images/cart.png', plugin_dir_path( __FILE__ ) );
Expand Down
10 changes: 5 additions & 5 deletions src/Transactions/AbstractTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ public function setItemsTransaction($items): void
$product = $item->get_product();
$quantity = $item->get_quantity();

$title = $product->get_name();
// TODO Here is product name for transaction
$title = 'Product';
$title = "$title x $quantity";

$amount = $this->getItemAmount($item);
Expand All @@ -289,7 +290,7 @@ public function setItemsTransaction($items): void
$item = [
'id' => $item->get_product_id(),
'title' => $title,
'description' => $this->mercadopago->helpers->strings->sanitizeAndTruncateText($product->get_description()),
'description' => 'Common product for sale', // TODO description of product is hidden too $this->mercadopago->helpers->strings->sanitizeAndTruncateText($product->get_description()),
'picture_url' => $this->getItemImage($product),
'category_id' => $this->mercadopago->storeConfig->getStoreCategory('others'),
'unit_price' => $amount,
Expand Down Expand Up @@ -387,9 +388,8 @@ public function getItemAmount(\WC_Order_Item $item): float
*/
public function getItemImage($product): string
{
return is_object($product) && method_exists($product, 'get_image_id')
? wp_get_attachment_url($product->get_image_id())
: $this->mercadopago->helpers->url->getPluginFileUrl('assets/images/gateways/all/blue-cart', '.png', true);
// TODO hide image from product
return $this->mercadopago->helpers->url->getPluginFileUrl('assets/images/gateways/all/blue-cart', '.png', true);
}

/**
Expand Down

0 comments on commit e9347b1

Please sign in to comment.