push back from product owner keep asking about timeline

It’s really tiring and annoying when every task required me to give a estimates time to complete. It’s asked by my manager. I can do it fast and slow, depends on the quality. This bad demand just got me mad and just install bunch of 3rd party libraries to get the job done.

How can I stop someone’s else behaviour?

magento2 – Show related products with list style on product page in Magento 2?

I was able to show the related products on the product page inside the ‘related product’ tab. However, it is in grid style. I’m wondering if there is a way to show them with “list style” ( like the category list page)?

enter image description here

this is the related product section of the catalog_product_view.xml

    <!--related product tab-->
    <block class="MagentoCatalogBlockProductProductListRelated" name="product.info.related" template="Magento_Catalog::product/view/info.phtml" group="detailed_info">
        <arguments>
            <argument name="type" xsi:type="string">related</argument>
            <argument translate="true" name="title" xsi:type="string">Related Products</argument>
            <argument name="sort_order" xsi:type="string">40</argument>
            <argument name="priority" xsi:type="string">6</argument>
        </arguments>            
    </block>

this is my current phtml template for related product

<?php
 echo $block->getChildHtml('catalog.product.related');
?>

I want it to show like this ( list style)
enter image description here

javascript – MMMRjs a product of BYTES Genesis

Hello there, I am Syed Mohammad Sannan a team member of BYTES Genesis

We have published a product today called MMMR.js this product is licensed under the MIT license and is
built by

Syed Mohammad Sannan

The uniqueness of this product is that it is built with and for Javascript though there are many libraries out there such as NumPY, SciPY, and much much more but they are built for Python or another language and there isn’t one for Javascript that is where MMMR.js comes.

View more details for this product over here: https://mmmrjs.000webhostapp.com/

This is the source code of MMMR.js

// Mean - The average value.
// Median - The mid point value.
// Mode - The most common value.
// Range The smallest and the biggest value.

// This is Mean.
// Mean returns the average value from an array of numbers.
// To call/run this function we can type mean(Your array of numbers separated with commas ',');
const mean = (numbers) => {
  let total = 0,
    i;
  for (i = 0; i < numbers.length; i += 1) {
    total += numbers(i);
  }
  return total / numbers.length;
};



// This is Median.
// Median returns the middle point value from an array of numbers.
// To call/run this function we can type median(Your array of numbers separated with commas ',');
const median = (numbers) => {
  const sorted = numbers.slice().sort((a, b) => a - b);
  const middle = Math.floor(sorted.length / 2);

  if (sorted.length % 2 === 0) {
    return (sorted(middle - 1) + sorted(middle)) / 2;
  }

  return sorted(middle);
};



// This is Mode.
// Mode returns the most common/used value from an array of string, numbers, etc.
// To call/run this function we can type mode(your array of numbers);
const mode = (a) => {
  a.sort((x, y) => x - y);

  let bestStreak = 1;
  let bestElem = a(0);
  let currentStreak = 1;
  let currentElem = a(0);

  for (let i = 1; i < a.length; i++) {
    if (a(i - 1) !== a(i)) {
      if (currentStreak > bestStreak) {
        bestStreak = currentStreak;
        bestElem = currentElem;
      }

      currentStreak = 0;
      currentElem = a(i);
    }

    currentStreak++;
  }

  return currentStreak > bestStreak ? currentElem : bestElem;
};



// This is Range.
// Range is basically a function used to return the smallest and the biggest values from an array of numbers.
// To call/run this function we can type range(your array of numbers);
const range = (value) => {
  value.sort();
  return (value(0), value(value.length - 1));
}

We just wanted you to review this code and tell us is this library user-friendly, maintainable and what improvements can we add to this.

magento2 – Image’s don’t upload on product page and shows spinner icon

I’m attempting to add product images when adding a new product but I’m having a problem. The image uploads, but the spinner remains. As shown below:

enter image description here

I’ve done some digging. If I open the inspector window I see the following error:

Uncaught TypeError: Cannot read property 'value' of undefined
at product-gallery.js:138
at Function.grep (jquery.js:471)
at $.<computed>.<computed>.setBase (product-gallery.js:133)
at $.<computed>.<computed>.setBase (jquery-ui-1.9.2.js:432)
at $.<computed>.<computed>._addItem (product-gallery.js:217)
at $.<computed>.<computed>._addItem (jquery-ui-1.9.2.js:432)
at HTMLDivElement.handlerProxy (jquery-ui-1.9.2.js:739)
at HTMLDivElement.dispatch (jquery.js:5232)
at HTMLDivElement.elemData.handle (jquery.js:4884)
at Object.trigger (jquery.js:5136)

Which leads to the following code:

enter image description here

I put a breakpoint there and .value is null.

The image uploads, but only to the products/tmp directory. I’ve checked all error files in var/log and nginx and php logs. There’s no errors.

Anyone know why this might be happening? All permissions are correct (775 for media/* directory). Can’t understand what would cause this. Also happens if I switch back to Luma from my current theme.

The theme I’m using has no adminhtml that’s overriding anything.

Any advice?

magento2 – Magically special_from_date is set whenever product is updated

I got a weird issue i can’t see to find the reason behind it.
When i update product with a special_price and the special_from_date is NULL (empty) it updates the special_from_date to today.. And i can’t seem to find why..

Is this a common bug? (i don’t think so) but i also can’t seem to find the root of the problem.
thanks in advance!

And for a short workaround how can i safely disable special_from_date or just don’t let it update?

magento2.3 – Magento 2.3 – Product images in order history

I want to load max 3 product images in the order history page on customer account.

I currently have a perfectly working code using $objectManager. But because Magento does not recommend to use objectManager, I want to transform this into a module.

How can I transform this code into a module?

Code:

<?php $objectManager = MagentoFrameworkAppObjectManager::getInstance();
            $_product = $objectManager->get('MagentoCatalogModelProduct')->load($itm->getProductId());
            $imageHelper  = $objectManager->get('MagentoCatalogHelperImage');
            $image_url = $imageHelper->init($_product, 'product_page_image_small')->setImageFile($_product->getImage())->resize(160, 160)->getUrl();?>

Magento 1.9 Custom extension not displaying block in product view

I have been trying to display a custom template in the product view page in a simple extension but it only works for some references: product.info.additional, product.info.extrahint, product.tooltip and product.info.addtocart.

My app/design/frontend/base/default/layout/productest.xml looks like this. I m trying to display a simple text now but to no success:

<?xml version="1.0"?>
<layout version="0.1.0">
  <catalog_product_view>
    <reference name="product.info">
        <block type="core/text" name="core-text"><action method="setText"><text><!(CDATA(<div>Souh</div>))></text></action></block>
    </reference>

  </catalog_product_view>
</layout>

I have also echoed the block names that are used in the product page:

Array
(
    (0) => product.info.media
    (1) => alert.urls
    (2) => product.info.upsell
    (3) => product.info.additional
    (4) => product.description
    (5) => product.attributes
    (6) => catalog.product.related
    (7) => product.info.addto
    (8) => product.info.sharing
    (9) => product.info.addtocart
    (10) => product.info.extrahint
    (11) => product.info.options.wrapper
    (12) => product.info.options.wrapper.bottom
    (13) => product.info.container1
    (15) => product.info.additional.recurring.schedule
    (16) => product.reviews
    (17) => product.info.simple
    (18) => product.info.availability
)

I don’t understand why not all of them can be extended/referenced when they all appear to be called in the product page.

Thank you in advance for your help.

magento2.3 – Layout switcher for product view magento 2.3.5 (Custom layout update)

Since the update to Magento 2.3.x it is possible to change the layout of the product output using a product id or sku:

Unfortunately there is no possibility to give different designs generally for product types with custom layout update like:

catalog_product_view_selectable_<to-all-products>_<layout-name>.xml

Is there any other way to control the design of the product output in admin?

As an example I would need for the bundle product three different layouts in the frontend, which layout should be loaded controllable via admin in the product itself.

java – Print SubArray of Maximum Contiguous product in Array

Maximum Product Subarray
Given an array that contains both positive and negative integers, find the subarray of the maximum product .
Examples:

Input: arr[] = {6, -3, -10, 0, 2}
Output: The subarray is {6, -3, -10}

Input: arr[] = {-1, -3, -10, 0, 60}
Output: The subarray is {60}

Input: arr[] = {-2, -3, 0, -2, -40}
Output: The subarray is {-2, -40}

php – How to rearange the order of product input fields

Hi all I am trying to figure out how to move a product input field on the product page, I have done this previously with the hooks, but I can’t find how to target the input field as i am not sure what the class is for it. This is the input field addon plugin I am using: https://docs.woocommerce.com/document/product-add-ons/ I hope someone can help as I have been trying for some time now, thank you!