texts: Difference After Upgradation in Magento2

texts:
I have one website in Magento 2.2.1, Now We are planned and Upgrade Website in  2 instances one from Composer and Another from Manually Way(Downloaded form Magento Website).

Now we are on the point where we found many differences while comparing Vendor Folder of Both Instance after Upgrade.

My Findings Like -

23 New Directories added in Manually Upgrade while Composer instance does not have.
Many Files have difference while compare
Manual Upgrade have Many modules from vendor have Upgraded versions while composer does not have.

  Why there are difference in Composer Update and Manual Upgrade?

  Which one is better for Upgrade ?

Can anyone Help me on this?


texts: Filtering by custom column make an error

texts:
I need a new "dynamic" column in my custom grid so
I created grid, I extend \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult and I add in _beforeLoad() new column:

const NEW_COLUMN = "(SELECT COUNT(*) FROM my_table WHERE group_id=main_table.group_id)";

 $this->getSelect()
            ->columns(['new_column' => new \Zend_Db_Expr(self::NEW_COLUMN)])

Sorting by this column work perfectly, but when I try to use a filter I got an error:

  Column not found: 1054 Unknown column 'new_column' in 'where clause'

Here are SQL queries:

Grid query:

SELECT `main_table`.*, (SELECT COUNT(*) FROM my_table WHERE a.group_id=main_table.group_id) AS `new_column` FROM `main_base_table` AS `main_table` WHERE (`type` = '0') LIMIT 20

Filter query:

SELECT COUNT(*) FROM `main_base_table` AS `main_table` WHERE (`new_column` >= '1') AND (`new_column` <= '3') AND (`type` = '0')


texts: Update QTY checkout cart Magento not working after update to 1.9.2.4

texts:
In 2014 I've added some code to auto update the product qty in the cart checkout of Magento so if I were to change the qty of the product it automatically updates this. Sometimes a customer forgets to press enter or click on update shoppingcart. This worked very well.

I've placed this code in the head.phmtl file of my template:

<script type="text/javascript">
function ajaxCartPost(item){
    element='cart[' + item +'][qty]';
    qty=document.getElementById(element).value;
    jQuery.ajax({
        url: '<?php echo Mage::getUrl('checkout/cart/ajaxcart')?>',
        dataType: 'json',
        data: jQuery("form#cartform").serializeArray(),
        type:'POST',
        success: function(data) {
            if(data.status == 'Y'){
                jQuery('.cart').replaceWith(data.cart);
            }
        }
    });
    return false;
}

And disabled this line in /app/design/frontend/base/default/template/checkout/cart/item/default.phtml

<input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" title="<?php echo $this->__('Qty') ?>" class="input-text qty" maxlength="12" />

with

<input name="cart[<?php echo $_item->getId() ?>][qty]" id="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" title="<?php echo $this->__('Qty') ?>" maxlength="12" style="float: left; width:1.9em!important;" onkeyup="ajaxCartPost(<?php echo $_item->getId() ?>);"  />

I've updated the Magento shop from version 1.9.0.1 to 1.9.2.4 and all of a sudden this doesn't work anymore. I did some tracing to check and see if there was an error but there is none. Can someone point me to the right direction?

Br,

Steve


texts:
ihave problem again with my rewrite, i tried create rewrite model on my lesson
app/code/local/Lesson/Test/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Lesson_Test>
            <version>1.0.0</version>
        </Lesson_Test>
    </modules>

    <global>
        <models>
            <customer>
                <rewrite>
                    <product>Lesson_Test_Model_Customer</product>
                </rewrite>
            </customer>
        </models>
    </global>
</config>

app/code/local/Lesson/Test/Model/Customer.php

<?php
class Lesson_Test_Model_Customer  extends Mage_Customer_Model_Customer
{
    public function getName()
    {
        $name = '';
        if ($this->getPrefix()) {
            $name .= $this->getPrefix() . ' ';
        }
        $name .= $this->getFirstname();
        if ($this->getMiddlename()) {
            $name .= ' ' . $this->getMiddlename();
        }
        $name .=  ' ' . $this->getLastname();
        if ($this->getSuffix()) {
            $name .= ' ' . $this->getSuffix();
        }
        return $name.'22222222';
    }
}

app/etc/modules/Lesson_all.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Lesson_Test>
            <active>true</active>
            <codePool>local</codePool>
        </Lesson_Test>
    </modules>
</config>

i try access

http://127.0.0.1/magento/index.php/lesson
http://127.0.0.1/magento/index.php/customer/customer
http://127.0.0.1/magento/index.php/customer/product
http://127.0.0.1/magento/index.php/lesson/customer/customer
http://127.0.0.1/magento/index.php/lesson/customer/product

the all of this is Whoops, our bad..., thank you :)


texts: Base Url getting append in external url in header

texts:
I have a text field in System config, where url is put say wwww.facebook.com.
Now when I am echoing the value from config in header it's giving me correct value.
But when I am putting it in this code and printing it's giving  url as www.mybaseurl.com/www.facebook.com

Why is my baseurl getting append in front of that url? I am writing this code in header.phtml

CODE:

$facebook = Mage::getStoreConfig('social/socialgroup/facebook');
$twitter = Mage::getStoreConfig('social/socialgroup/twitter');
$google = Mage::getStoreConfig('social/socialgroup/google');

<a href="<?php
      if ($twitter !== ""):echo $twitter;
       else: echo "javascript:void(0);";
       endif;
       ?>">

<a target="_blank" href="<?php
        if ($facebook == ""):echo "javascript:void(0);";
          else: echo $facebook;
           endif;
          ?>">

<a href="<?php
          if ($google !== ""):echo $google;
          else: echo "javascript:void(0);";
           endif;
            ?>">


texts: Magento is writing exceptions to var/reports with 0640 permissions, owned by "nobody". My user can't access them. How can I change this?


texts:
No change in the products take effect on the frontend, unless I reindex and clear the cache. Is that normal?

When my website was first up live, I don't remember having an issue like this.

Does anybody know anything about this?


texts: How to add/join sales_flat_order.customer_firstname column to transaction grid?

texts:
I have the collection for transaction and I added a line to get customer_firstname:

  protected function _prepareCollection()
    {
        $collection = ($this->getCollection())
            ? $this->getCollection() : Mage::getResourceModel('sales/order_payment_transaction_collection');
        $order = Mage::registry('current_order');
        if ($order) {
            $collection->addOrderIdFilter($order->getId());
        }
        $collection->addOrderInformation(array('increment_id'));
        $collection->addPaymentInformation(array('method'));
       $collection->joinAttribute('customer_firstname','sales_order/customer_firstname','sales_flat_order.increment_id=sales_payment_transaction.order_id', null,'inner',null);
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

here are the parameters for join attribute function:

joinAttribute(
    $alias,
    $attribute,
    $bind,
    $filter = null,
    $joinType = 'inner',
    $storeId = null
)

so it seems I did not do anything wrong

and then when preparing columns I did this:

    protected function _prepareColumns()
    {
             $this->addColumn('customer_firstname', array(
            'header' => Mage::helper('sales')->__('First Name'),
            'index'=>'customer_firstname',
            'type'  => 'text'
        ));
}

It doesn't show me anything.how can i achieve this?
I want to have the join

I don't want to go through the renderer because I know how to do it and I need to do it this way because I need to have filter in this new column


texts: Magento 2.2.11 - How to add attachment to an email, Call to undefined method Magento\Framework\Mail\Message\Interceptor::createAttachment() error

texts:
I have installed the pdf invoice Extension in Magento 2.2.11. I'm getting this error while placing the order,

Call to undefined method
Magento\Framework\Mail\Message\Interceptor::createAttachment() in
/app/code/MyVendor/PdfInvoice/Model/TransportBuilder.php:19

MyVendor/PdfInvoice/Model/TransportBuilder.php
<?php

namespace MyVendor\PdfInvoice\Model;

class TransportBuilder extends \Magento\Framework\Mail\Template\TransportBuilder
{
    /**
    * @param Api\AttachmentInterface $attachment
    */
    public function addAttachment($pdfString, $type = '')
    {
        $fileattached =  @file_get_contents($pdfString);
        $this->message->createAttachment(
            $fileattached,
            'application/pdf',
            \Zend_Mime::DISPOSITION_ATTACHMENT,
            \Zend_Mime::ENCODING_BASE64,
            $type.'.pdf'
        );
        return $this;
    }
    /**
     * clear header
     * @param $headername
     */
    public function clearHeader($headerName)
    {
        if (isset($this->_headers[$headerName])) {
            unset($this->_headers[$headerName]);
        }
        return $this;
    }
}

When I replace this below code,

$this->message->createAttachment(
            $fileattached,
            'application/pdf',
            \Zend_Mime::DISPOSITION_ATTACHMENT,
            \Zend_Mime::ENCODING_BASE64,
            $type.'.pdf'
        );

with this code

$attachment = new \Zend\Mime\Part($fileattached);
        $attachment->type = 'application/pdf';
        $attachment->disposition = \Zend_Mime::DISPOSITION_ATTACHMENT;
        $attachment->encoding = \Zend_Mime::ENCODING_BASE64;
        $attachment->filename = $type.'.pdf';
        return $attachment;

Emails are sending but the attachment is not included in the mail.
I have tried the below solution but didn't work.
Magento 2.3 custom email attachment not working
https://github.com/mageplaza/magento-2-email-attachments/issues/4
Let me know if anyone has any ideas.


texts:
I have a project in which we are using Magento 1.4 API for mobile app now we want to migrate our platform to Magento 2.x .

My question is that what's different in Magento 2 API V/s Magento 1 API implementation has any one experience on this scenario help will be appreciated.

Thank You


texts:
Evening,
I'm trying to run the following command
composer show magento/product-community-edition 2.4.* --all | grep -m 1 versions

but I am getting an output of the following:

versions : * 2.4.2
[Symfony\Component\Console\Exception\RuntimeException]
Unable to write output.
show [--all] [--locked] [-i|--installed] [-p|--platform] [-a|--available] [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [-l|--latest] [-o|--outdated] [--ignore IGNORE] [-m|--minor-only] [-D|--direct] [--strict] [-f|--format FORMAT] [--no-dev] [--] [] []

I've had a look at file/folder permissions and set them again
find var generated vendor pub/static pub/media app/etc -type f -exec chmod u+w {} + && find var generated vendor pub/static pub/media app/etc -type d -exec chmod u+w {} + && chmod u+x bin/magento

I've also tried to install the cron again
bin/magento cron:install --force

But alas nothing helps.


texts: Get bundle product items in cart of Magento2

texts: I need to get bundle products from cart, and than I need to get the selected items of every bundle product. ?


texts: Magento 2 AJAX Post to another module's controller

texts:
I was wondering if it were possible to send an AJAX Post over to a controller contained within a custom module I have created. The reason for doing this is because I want to separate my logic out from the module-sales module.

Alternatively, would it be possible to contain the controller within Magento_Sales as currently my folder structure for this just contains overridden frontend files such as layout / template etc. Any help appreciated on this, cheers


texts: Any alternative for this magento documentation?

texts:
I need an alternative for this documentation because I just can't open it here. It's almost impossible. I've been searching and I found this one but it doesn't have all I need... I found [another one]3 also, but the project I'm working on doesn't use GraphQL.
Thank you all


texts: Catalog product image upload files button not responding

texts:
I tested it in all Magento version shops we have version like 1.7, 1.8 and 1.9 and in all the button Upload files is not responding when I click on it. I tried to open the shops in Chrome, Mozilla and IE. With what could be this connected ?

I update the Adobe Flash on my computer but it is still not working.

In console there is no error.

How could I resolve this ?
Thank you.


texts: magento 2 dynamic value not comes in custom email template

texts:
I am trying to send dynamic value in my custom email template. I can send email with my custom template, but dynamic value not able to pass in that email.
Here is my code for send email

$parseDataVars = new \Magento\Framework\DataObject();

        $retrievalcode = "somecustomcode";
        $parseDataVars->setData(array('recipient_name' => $retrievalcode));

        $this->temp_id = $this->getTemplateId(self::XML_PATH_EMAIL_TEMPLATE_FIELD);
        $this->inlineTranslation->suspend();
        //$this->generateTemplate($emailTemplateVariables,$senderInfo,$receiverInfo);

        $this->_transportBuilder->setTemplateIdentifier($this->temp_id)
            ->setTemplateOptions(['area' => 'frontend', 'store' => $storeId])
         ->setTemplateVars(array('data' => $parseDataVars))
        ->setFrom(
           $senderInfo
        )->addTo(
            $receiverInfo['email'],$receiverInfo['name']
        );

        $transport = $this->_transportBuilder->getTransport();
        $transport->sendMessage();
        $this->inlineTranslation->resume();

My email template

{{template config_path="design/email/header_template"}}

            You purchased a  {{var recipient_name}} at .

            Look forward to seeing you at our store.

{{template config_path="design/email/footer_template"}}

If anyone can know where i make mistake then please let me know why this code is not working.

Thank you


texts: Shipping methods disabled in checkout: Magento 1.9

texts: I have an issue with the shipping methods on the checkout page in Magento 1.9. When I add the products into the cart and then try to check out, I notice that the shipping methods displayed are disabled and I am not able to select any of them.


texts:
How to solve below error

  Fatal error: Uncaught Error: Class
  'Mage_Companyname_Deliverydate_Block_Adminhtml_Mappingdate' not found
  in
  \app\code\core\Mage\Core\Model\Layout.php
  on line 590

below is my files

  app/code/local/Companyname/Deliverydate/Block/Adminhtml

<?php

class Companyname_Deliverydate_Block_Adminhtml_Mappingdate
    extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
{

    public function __construct()
    {
        $helper = Mage::helper('deliverydate');

        $this->addColumn('column_one', array(
            'style' => 'width:200px',
            'label' => $helper->__('Column One'),
        ));

        $this->addColumn('column_two', array(
            'style' => 'width:200px',
            'label' => $helper->__('Column Two'),
        ));

        $this->addColumn('column_three', array(
            'style' => 'width:80px',
            'label' => $helper->__('Column Three'),
        ));

        parent::__construct();
    }
}

  Config.xml

<global>
 <blocks>
  <deliverydate>
     <class>Companyname_Deliverydate_Block</class>
  </deliverydate>
 </blocks>
  <helpers>
      <deliverydate>
            <class>Companyname_Deliverydate_Helper</class>
      </deliverydate>
   </helpers>
<default>
            <deliverydate>
                <deliverydate_general>
                    <enabled>0</enabled>
                    <on_which_page>1</on_which_page>
                    <deliverydate_format>d/M/Y</deliverydate_format>
                    <deliverytime_format>g:i a</deliverytime_format>
                    <deliverydate_dayoff></deliverydate_dayoff>
                    <mapping_date></mapping_date>
                </deliverydate_general>
            </deliverydate>
        </default>
</global>

  system.xml

<config>
    <sections>
        <deliverydate translate="label" module="deliverydate">
            <class>separator-top</class>
            Delivery Date
            <tab>Companyname</tab>
            <sort_order>130</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <deliverydate_general translate="label">
                    General
                    <frontend_type>text</frontend_type>
                    <sort_order>10</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
      <mapping_date>
       Date Off                  <frontend_model>companyname_deliverydate/adminhtml_mappingdate</frontend_model>                          <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
                            <sort_order>10</sort_order>
                            <show_in_default>1</show_in_default>   <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </mapping_date>
                    </fields>
                </deliverydate_general>
            </groups>
        </deliverydate>
    </sections>
</config>


texts: magento locale date format in transactional emails

texts:
My shop local is sl_SI and my current date format in order confirmation email is: 19. februar 2016 16.32.25 CET

What I want to achieve is, to make this date format like this: 19. februar 2016 16:32:25 CET

In email template there is a default date call: {{var order.getCreatedAtFormated('long')}}

I did try to change locale date&time format in /lib/Zend/Locale/Data/si.xml like this:

<timeFormatLength type="full">
    <timeFormat>
        <pattern>a h:mm:ss zzzz</pattern>
    </timeFormat>
</timeFormatLength>
<timeFormatLength type="long">
    <timeFormat>
        <pattern>a h:mm:ss z</pattern>
    </timeFormat>
</timeFormatLength>
<timeFormatLength type="medium">
    <timeFormat>
        <pattern>a h:mm:ss</pattern>
    </timeFormat>
</timeFormatLength>
<timeFormatLength type="short">
    <timeFormat>
        <pattern>a h:mm</pattern>
    </timeFormat>
</timeFormatLength>

but without success. If I change the locale in magento admin to it_IT, I can get desired date&time format. If I replace the si.xml file with it.xml content, it won't work. Like something is overriding my si.xml date format. Any suggestions?


texts: Add option price to the final price of the product

texts:
I have product with custom options.
I want to show the price = regular price + option value

In the price.phtml I have found this:

<div class="price-box">
    <?php $_convertedPrice = $_store->roundPrice($_store->convertPrice($_product->getPrice())); ?>
    <?php $_price = $_taxHelper->getPrice($_product, $_convertedPrice); ?>
    <?php $_regularPrice = $_taxHelper->getPrice($_product, $_convertedPrice, $_simplePricesTax); ?>
    <?php $_finalPrice = $_taxHelper->getPrice($_product, $_convertedFinalPrice) ?>
    <?php $_finalPriceInclTax = $_taxHelper->getPrice($_product, $_convertedFinalPrice, true) ?>
    <?php $_weeeDisplayType = $_weeeHelper->getPriceDisplayType(); ?>
    <?php if ($_finalPrice >= $_price): ?>

Suppose the regular price of the product is 500 and Option value is +50
then in the product page how can i show 550 when the page is loaded (without clicking on the option radio button)

So far I tried this:

  (this works fine in
  app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php)

if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_RADIO
            || $_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX
            ) {
             $_productId = $this->getProduct()->getId();
                $_product = Mage::getModel('catalog/product')->load($_productId);
                $spl_price=$_product->getFinalPrice();
                if($count==2)
                {
                    $rent=$this->helper('core')->currencyByStore($_value->getPrice(true), $store, false);
                }
                else
                {
                    $buy=$this->helper('core')->currencyByStore($_value->getPrice(true), $store, false);
                }
                $total_rent = $rent + $spl_price;

            }

  But doesn't work with price.phtml file.

And i tried to pass $total_rent in this:

<?php $_finalPrice = $_taxHelper->getPrice($$total_rent) ?>

but I suppose it doesn't work this way here.

ScreenShot: Check the first arrow. I want to replace 200 with 700.


texts:
When we add a product to cart, the loading icon appears, but stay there indefinitely.
The item does appear  in the cart if we reload the page, it is kinda like if the icon was set to appear for unlimited time or failed to disappear.
Can you help us ?

We are on magento 1.9 version


texts: How to add back to top button in Magento 2?

texts:
I want to add back to top button on our site. I referred the below link http://magentosource.blogspot.com/2013/10/add-back-to-top-button-in-magento.html

But we have no footer.phtml.

Could anyone please help me where to add this footer.html and how to create back to top button?


texts:
I want to load all reviews and all ratings of a specific product using product id so i have made a module but problem is that i am not able to load detail reviews and detail rating of any specific product using product id only. i want to use it on categories page. i want this

and i have completed jquery part only product loading part is left please help me as soon as possible. I want to use foreach command not any other command.


texts: how to avoid bundled products getting automatically assigned as upsell products for simple products

texts:
I use Magento CE 1.8.1 once i create a bundle products by assigning some of my simple products    to the bundle items. Once created i can see that for all my simple products that has been used to create a bundle product includes the newly created bundled product as an upsell product.

How can i avoid this situation so that the bundled products should not be automatically assigned as upsell products unless i assign it manually.

I do not want to comment out or exclude the whole upsell.phtml file as i need it to assign for other simple products.I just want to exclude this functionality for simple products that are used to create bundle items.

Note:I want to sell my product seperately as well as bundle product i cannot use  visibility:not visible individually  nor status:disable options.


texts: Magento 2.1: Custom Shipping method - Need to access Region name in `collectRates` method

texts:
I am creating a custom shipping method by following this tutorial. Now I want to access the region name in the collectRates method. I can access the region_code if the State/Province field is a dropdown, but it isn't the case for all the countries.

I actually want the shipping method to be available to only a certain state. How can I do this?

Thanks


texts: how to show my account link in header after successfully login in magento 2.0


texts: Magento 2: extension installation module outdated issue

texts:
I am trying to install a magento 2 extension. Facing this exception error on website.

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Please upgrade
your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
******_*** schema: current version - 1.0.1, required version - 1.0.0
******_*** data: current version - 1.0.1, required version - 1.0.0


texts: How to Get Magento Bundle Product Qty From Order

texts:
I try this code to get qty of products from order.

$orderId = 'My Order ID;
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
$items = $order->getAllVisibleItems();

foreach ($items as $item) {
    $qty[$item->getName()] = $item->getQtyToInvoice();
}

print_r ($qty);

The above code not work for bundle product, it returns 0.

But for others product type, it works.


texts: Minicart shows the wrong cart qty after add product to the cart programmatically

texts:
I'm using magento v2.4.1 and i tried to add a product programmatically to the cart like this from salesrule_validator_process observer :
                    $newQuoteItem = $quote->addProduct($product,'1');
                    $newQuoteItem->setCustomPrice(0);
                    $newQuoteItem->setOriginalCustomPrice(0);
                    $newQuoteItem->setBaseTaxCalculationPrice(0);
                    $newQuoteItem->setTaxCalculationPrice(0);
                    $newQuoteItem->setNoDiscount(true);
                    $newQuoteItem->getProduct()
                        ->setIsSuperMode(true);
                    $newQuoteItem->calcRowTotal();

The product shows perfectly in the minicart and cart page , however the minicart qty does not get updated


texts: Layered navigation product count issue after elasticsearch

texts:
We are facing issue in layered navigation product count after enabling elastic search in Magento 2.3.1

Link which was working earlier before enabling elastic search

Now, this file is not called.

Can anyone help me with this?


texts:
i analyzed my website on Gmetrix.com for for optimization and the result was this:

  361.0KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.

http://mysite.com/media/js/b5de567c1b6b9d971394b4d4887370a1.js (351.7KiB)
http://mysite.com/ (9.3KiB of inline JavaScript)

  Defer parsing of JavaScript

  In order to load a page, the browser must parse the contents of all
   tags, which adds additional time to the page load. By
  minimizing the amount of JavaScript needed to render the page, and
  deferring parsing of unneeded JavaScript until it needs to be
  executed, you can reduce the initial load time of your page.

how to solve it?


texts: Magento 2 : Difference among afterMethodName, beforeMethodeName and aroundMethodName?

texts: What are the difference in afterMethodName, beforeMethodeName and aroundMethodName which we are using for Override ?


texts: Is there ever a reason to prefer $model->load() over service contracts?

texts:
I understand that the preferred way to work in between modules in Magento 2 is using the service contracts.

So if I want to load a product, I use the product repository:

$product = $productRepository->getById($id);

which is by contract returning an instance of Magento\Catalog\Api\Data\ProductInterface.

But I could also use the old way instead, calling the domain layer directly:

$product = $productFactory->create()->load($id);

Is there any case where this would be necessary or useful?

The devdocs say (highlight added):

  A module can directly call into another module. This tightly coupled solution is not recommended for most situations, but is sometimes unavoidable.

  [...]

  Your strategy for calling another module’s domain-layer code is highly dependent upon the unique configuration and needs of your system.

Source: http://devdocs.magento.com/guides/v2.0/architecture/archi_perspectives/domain_layer.html

And a comment on a related question stated:

  using the Repository will give you a Product data model (Api/Data/Product), which is a Product model converted into a dumbed-down DTO. Something to consider, as they're quite different

But as far as I can see the objects are the same under normal conditions, just the return types per phpDoc differ (Magento\Catalog\Api\Data\ProductInterface / Magento\Catalog\Model\Product)


texts: get product name, price, image url and specific other fields with an array of ids

texts:
I am not clear on this, but want to do a bare-bones query which would have everything at the time the query is made, not only the id and product type.  I have an array of entity_id values, and I only one specific columns in the fieldset.  Specifically, name, description, price, image URL and that's it.

How would I do this?  I am new enough to Magento to not understand this concept.  Here is a pseudo-code of what I'm trying to accomplish:

$productIds = array(5, 22, 45, 75, 88);
$products = Mage::getModel('catalog/product')
            ->addAttributeToFilter('entity_id', array('in' => $productIds))
            ->addFields('name','description', .. etc.. 'imageUrl')
            ->load();

foreach($products as $idx=>$obj){
    $data = $obj->getData(); //and hopefully this data is there and we don't need to requery the database.


texts: How to Add a new Tab in Product View Page in Magento 2

texts:
I want to add a new tab in the product view page similar to Details.

  I have tried adding a file 'catalog_product_view.xml' at the location
  "app/code/Magento/Catalog/view/frontend/layout/" and added the below
  code

    <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="product.info.details">
                <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description.extra" template="product/view/attribute.phtml" group="detailed_info">
                    <arguments>
                        <argument name="title" translate="true" xsi:type="string">Custom</argument>
                    </arguments>
                 </block>
            </referenceBlock>
        </body>
   </page>


texts: New order email missing sales_email_order_items block

texts:
The new order email template is rendering everything except the contents of the order. I've tested that I'm looking at the correct template by adding in dummy text so I'm definitely in the right place.

This is how the template was trying to call it by default, which doesn't work:

{{layout handle="sales_email_order_items" order=$order}}

I've tried a few other ways of calling the block also such as:

{{block type="sales_email_order_items" order=$order}}

{{block type="sales_email_order_items" order=$order}}

{{block type="sales/email_order_items" template="email/order/items.phtml"  order=$order}}

These clearly didn't work, or I wouldn't be posting here. Can anyone advise on what might be the problem.


texts:
I am displaying custom options for my products on the product list. The problem is that when you select an option, the price is not updated. This works fine on the individual product page, but not on the product list.

Here's the code I'm using to display the custom options:

Please don't use this code in production. It is messy and incomplete.

<?php $productSku = $_product->getSku();
$product = Mage::getModel('catalog/product');
$productId = $product->getIdBySku( $productSku );

$product = Mage::getModel("catalog/product")->load($productId);

$attVal = $product->getOptions();

$optStr = "";

// loop through the options
foreach($attVal as $optionKey => $optionVal) {

//$optStr .= "<br/>";

//$optStr .= $optionVal->getTitle().": ";

$optStr .= "<select style='display:block; clear:both;' name='options[".$optionVal->getId()."]'>";

foreach($optionVal->getValues() as $valuesKey => $valuesVal) {
$optStr .= "<option value='".$valuesVal->getId()."'>".$valuesVal->getTitle()."</option>";
}

$optStr .= "</select>";

}

echo($optStr );
 ?>

Any ideas on how I can trigger the price change? Thanks.


texts: magento 2: copy production server to localhost

texts:
I copied my whole Magento 2.1 root directory to my local computer. Also exported and copied the database.sql to my local computer.

Then I setup XAMPP and created a db (with same name as db in production) -> imported the database.sql. After that I changed the base-url from Magento 2.1 to http://127.0.0.1:80/Servercopy/ -> then changed admin uri admin_grw0o8 to adminPath.

When opening url "http://127.0.0.1/Servercopy/" in Chrome it shows me correctly  my Magento 2.1 webshop.

Problem: When openeing url "http://127.0.0.1/Servercopy/adminPath" it shows error ERR_TOO_MANY_REDIRECTS

How can I solve this ?

Maybe when I change xampp hostname '127.0.0.1' to 'mydomain.com' ?


texts: Possible scenarios when product price html should be rendered or not in frontend grid or list

texts:
I would like to know what are the possible scenarios when product price html should be rendered for a product and if it's not rendered then why ?

The one that is know is when product is out of stock or say not saleable.
Need to figure out the rest.

One of my case is that prices are not getting rendered for a product in recently viewed products grid. I tried to debug the function getProductPriceHtml() but could not find any solution yet.

I checked in default magento2.1.3 with sample data , its displaying prices html for recently viewed products. So why not in my case ?

The html is something like this :

        RS 500.00

        RS 300.00

                    40% Off

Let me know the possible causes for my case as well.


texts:
I have created 2 cart rules, and I want them to override each other if conditions are met.

The rules are:

  If quantity of products with attribute-set SHIRT is greater than 15, then give discount of 10%

  If quantity of products with attribute-set SHIRT is greater than 25, then give discount of 20%

I am giving the first rule priority 2 and the second rule priority 1.

I would expect that the second rule would override the first rule when quantity of products with attribute-set SHIRT is greater than 25. But nothing happens, Magento just keeps giving 10% discount.


texts: You did not sign in correctly or your account is temporarily disabled:customer login

texts:
When I try to load /rest/v1/integration/customer/token, passing username and password in the body, it shows below error:

  {
      "message": "You did not sign in correctly or your account is temporarily disabled.",
      "trace": "#0 [internal function]: Magento\Integration\Model\CustomerTokenService->createCustomerAccessToken('mallika.sarna@h...',
  'bWFsbGlrYS5zYXJ...')\n#1
  /Applications/MAMP/htdocs/magentoshop/vendor/magento/module-webapi/Controller/Rest.php(330):
  call_user_func_array(Array, Array)\n#2
  /Applications/MAMP/htdocs/magentoshop/vendor/magento/module-webapi/Controller/Rest.php(239):
  Magento\Webapi\Controller\Rest->processApiRequest()\n#3
  /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/Interception/Interceptor.php(58):
  Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#4
  /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/Interception/Interceptor.php(138):
  Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch',
  Array)\n#5
  /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/Interception/Interceptor.php(153):
  Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#6
  /Applications/MAMP/htdocs/magentoshop/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(39):
  Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch',
  Array, Array)\n#7
  /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/App/Http.php(135):
  Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#8
  /Applications/MAMP/htdocs/magentoshop/generated/code/Magento/Framework/App/Http/Interceptor.php(24):
  Magento\Framework\App\Http->launch()\n#9
  /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/App/Bootstrap.php(256):
  Magento\Framework\App\Http\Interceptor->launch()\n#10
  /Applications/MAMP/htdocs/magentoshop/index.php(39):
  Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#11
  {main}" }


texts:
I am running Magento 1.9.0.1 and am having really bad issues with the Product Images showing on import via CSV.

I have been researching this issue for 3 days with no luck. When I upload an image manually when creating a single new product, it gets saved into a cached dir such as /1/9/imagename.jpg I have tried uploading images to that dir and then having the path in the CSV with no luck. I did not have a media/import directory, I created one and tried both the full pathing and just /imagename.jpg as suggested in other post. I have tried various php scripts that others claimed worked. Everything I try to do in 1.9.0.1 to get these images to show up has failed.

I have also been re-indexing and flushing cache. At this point, listing everything I have tried will take too long. I will be actively watching this question until I have it resolved :3

Please let me know what further information you need to attempt to help me on this, there is very little knowledge base for 1.9.0.1


texts: Can't install magento 1 - "The URL is not accessible. Unable to read response, or response is empty"

texts:
I try to install magento 1 on a local server.

I fail at the "Configuration" step.

The project is reachable under a VHOST which I have called http://entwicklung.m1fresh/

But if I press next, I get:

  "The URL is not accessible. Unable to read response, or response is
  empty"

Is there a way to bypass this?


texts:
In my admin area when I click on add product, I am directed to a screen with error 500, in my log, I have the following message

  "[2020-05-29 14:54:03] main.INFO: Broken reference: the
  'product.reviews' the element cannot be added as a child to
  'product_tabs', because the latter doesn't exist [] []

What could have happened?


texts: Magento 2 LESS - Unable to resolve the source file for ..., after deleting source file

texts:
I deleted a less file which I don't need anymore. I also removed the entry from default_head_blocks.xml so that it does not load anymore.

I searched my whole theme for main.css and removed all references to it.

But if I execute grunt refresh then I get Unable to resolve the source file for frontend/company/base/de_DE/css/main.less

So I executed grunt clean && grunt refresh but it makes no difference.

I also flushed all caches.


texts:
I am installing Magento and it gets stuck here, I followed all instructions online but I get stuck here. It does not give me error on the console log but it get stuck here for over an hour. Can someone please assist me?
Thank you


texts:
I have a Magento 2 store with around 20k products, and when I try to edit a product, it loading up the content and showing a spinner, but after few seconds, page freezes. But I see the content loaded behind the transparent loader background. But still the page is not accessible and browser asks to kill the page or wait.

Please see the image below,


texts:
Hi Programatically i want to change from base url https into http

<a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?>

// echo https://domain.com/checkout/cart/delete/id/5252/uenc/aHR0cDovL3RvdGFsdG95cy5jb20v/'

i want to change in

 <a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?>

// echo http://domain.com/checkout/cart/delete/id/5252/uenc/aHR0cDovL3RvdGFsdG95cy5jb20v/'


texts: Block core/list defined outside any layout handle

texts:
What does this definition of a block core/list mean, at the very end of checkout.xml, Magento CE 1.7.0.2:

[...]
        </checkout_onepage_failure>
    <block type="core/list" name="additional.product.info"/>
</layout>

Just a bug?


texts: Get all ordered products for all customers

texts:
I am using Magento 1.7. I want to get all the products that each one of the customers bought in the past.

Edit: I need the list of products because I am trying to design and implement a recommender system, and I need the products that the users bought in the past to try to use it as the data that will feed my system.

Any help is much appreciated.


texts: Fresh Magento 2.1.14, Readiness Check fail with conflicting component dependencies

texts:
My Magento is 2.1.14, fresh new. I am trying to install my first extension (Stripe payment extension), and this error occur.

===========================================
Check Component Dependency
We found conflicting component dependencies. Hide detail

For additional assistance, see component dependency help .

===========================================

As it doesn't show any useful information, I just want to know if anyone can help find the problem?

[Information of your environment]
My php version is 5.6.37
Cron scripts are:

/usr/bin/php -c /etc/php5/fpm/php.ini /home/kuohua/www/online-store/bin/magento cron:run > home/kuohua/www/online-store/var/log/magento.cron.log
/usr/bin/php -c /etc/php5/fpm/php.ini /home/kuohua/www/online-store/update/cron.php > /home/kuohua/www/online-store/var/log/update.cron.log
/usr/bin/php -c /etc/php5/fpm/php.ini /home/kuohua/www/online-store/bin/magento setup:cron:run > /home/kuohua/www/online-store/var/log/setup.cron.log


texts:
In Magento2, I have tried below code and getting response is Order EntityId.

http://localhost/pin/rest/V1/guest-carts/7775f2214c7e42e4b7a6d2e53dea34bc/order

             {
              "paymentMethod":{"method":"checkmo"},
               "shippingMethod":
              {
                "method_code":"flatrate",

                "carrier_code":"flatrate",
                "additionalProperties":{}

               }

             }

Any help to change response to Order IncrementId


texts: Magento2: Cart product delete after 10 minutes

texts: How to increase the guest cart session? Let me know how is it possible.


texts: Get every string of static block identifier Magento 1.9

texts:
I have to modify mega menu extension in Magento 1.9. Currently, its showing static block at bottom of category.

I want to separate static block identifier name based on some symbol like _ in my custom block code function.
In one of the block folder file below code is written.
const CUSTOM_BLOCK_TEMPLATE = "wp_custom_menu_%d";
 $blockId = sprintf(self::CUSTOM_BLOCK_TEMPLATE, $id);
 $collection = Mage::getModel('cms/block')->getCollection()
            ->addFieldToFilter('identifier', array(array('like' => $blockId . '_w%'), array('eq' => $blockId)))
            ->addFieldToFilter('is_active', 1);
        $blockId = $collection->getFirstItem()->getIdentifier();

Static block identifier is suggested to be named as wp_custom_menu_HereCatID
What i want is to achieve the  name of static block identifer as something like this wp_custom_menu_HereCatId_Right for Right and  wp_custom_menu_HereCatId_Bottom for Bottom position
I can use explode, but i want to learn in Magento way as done above.


texts: CSS and LESS, what is the correct way for including them in a Magento 2 module?

texts:
Let's say I have my module which adds a slider to the homepage and there are many styles to define. I know I can add the styles in 2 different ways:

Adding a css file MyBrand/MyModule/view/frontend/web/css/myfile.css
Or adding a less file MyBrand/MyModule/view/frontend/web/css/source/_module.less

Is there a «more correct» way of adding my file? Should I priorize adding .css instead of .less, is there a specific good practice?

In the Magento docs I don't see any specific guideline regarding this.

Just a note: In my case I wanted to use the function .media-width, so I had to chosse using less.


texts: How to show New Product 1st on Category page

texts:
I have added new product and it show at the end of the category page in magento 1.9.2.3.
Suppose if i have 2 page of category products than new product show at 2nd page at the end, but i want to show the product at 1st place on 1st page.  Anyone know how can i show newly product at 1st place in the category page.

thanks


texts:
I am using Magento 2.1.5, and I need to send email to admin after every 15 days with the list of new subscribers.

How to do this?


texts: Should I use Recurring Profiles for Subscriptions Feature

texts:
I'm building a subscription payments feature right now and I'm trying to determine whether using Magento's Recurring Profiles feature makes sense.

Of course, I would love to use the core feature, I like to be able to leverage core functionality wherever possible, but there are a number of reasons that I don't think it makes sense.

Requirements:

We want products to be able to be purchased regularly or on a subscription basis, very similarly to how Amazon subscriptions work.
We want to allow all subscription purchases to happen either every month, every 2 months, ... , 6 months.  In other words, we don't need granular billing periods define per product or category or anything.

Issues with Magento's Recurring Profiles

For starters, they were not released as a stable feature, but rather as a beta.
You can't checkout with regular products and subscription products in the same cart.  I don't really see any great reasons for this limitation.  I actually noticed a nice Magento site recently that does subscriptions without this restriction, and it's pretty neat: http://www.harrys.com/ (UPDATE: I think harrys launched on Magento in March of 2013, but is no longer on Magento).
A given product has to either be a subscriptions product (nominal product) or a regular one.  So you can't easily have a product page with both a Buy Now and a Subscribe button on it.
I don't really understand why they have recurring profiles defined on a per-product level.  That's not what I need in my case and I'd imagine it's not a common use case.
Shipping methods seem to have some hiccups with nominal products - haven't really dug into it too deep but it just adds to the madness.
It didn't seem to be built with the idea that subscription payment services (like Recurly, Chargify, Braintree) would be available to handle the meat of the subscription configuration / processing.  Maybe I'm completely wrong on that point b/c it was built against PayPal's recurring feature.

So, the approach that I want to take:

Have a custom option that's available for every product for them to determine whether they want to subscribe on a monthly, bi-monthly, etc. basis.
In the sales_order_place_after observer, check for any items in the cart with the subscription custom option set, and create subscriptions for them
Store the subscription ID in the sales_flat_order_item table.
Listen on Braintree webhooks for subscription charges, lookup the order item by subscription ID, generate an order an invoice for the product in question, with the same shipping method and tax amounts.

I'm hoping that there's not something massive that I'm missing here.


texts: Magento 2: How to get admin user detail load by id?

texts:
I have an admin user id 15, How to load the model to get username and user role?
In Magento1 this was possible using:

$adminuserId = 15;
Mage::getModel('admin/user')->load($adminuserId)->getRole()->getData();

How does it work in Magento2?


texts:
I want to translate the displayed date into Dutch.
My current code looks like this:

<?php
$post = $this->getPost();
$date = Mage::getModel('core/date');
?>

<?php echo $date->date('d F Y', $post->getCreatedTime()); ?>

But that does display the date as 07 March 2016. I want to translate the Month to Dutch, so it will be 7 Maart 2016.

How can I achieve that?


texts: Magento 2. Frontend. How do I subscribe to a property of my component

texts:
My question is pretty straight forward. I have JS component (an AMD module that extends from uiComponent) and I know I can make a property observable by specifying the tracks object in the defaults object for e.g.

defaults: { myProeperty: "Some Value", tracks: { myProperty: true }}

I wish now to subscribe to that change. For example execute a console.log every time myProperty value changes. How do I do that?


texts:
Hello World, I will jump right into it..

Desired Logic

I would like my template to dispatch an event every time the user clicks the
on and off buttons.
My view.phtml file look likes this...

/*Some Html*/

<?php
/*=== Variables ===========*/
$customer = Mage::getModel('customer/session')->getCustomer();
/*$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();*/
$groupId = $customer->getGroupId();
$group = Mage::getModel('customer/group')->load($groupId);
$groupCode = $group->getCode();

$OnArray = array(
   "value" => "on",
   "customer" => $customer
    );
$OffArray = array(
   "value" => "off",
   "customer" => $customer
    );
?>

  /* More HTML * /

<form action="">
    <input type="radio" name="auto-refill" value="On" onClick = "<?php Mage: dispatchEvent('autoFill_Update', $OnArray ?>" />On

    <input type="radio" name="auto-refill" value="Off" onClick = "<?php Mage: dispatchEvent('autoFill_Update', $OffArray ?>" />Off
</form>

Update
Based on the answers and comments I updated my template code..
I am still having trouble calling the controller from the view..
Code Update

<form action="">
    <input type="radio" name="auto-refill" value="On" onClick = "autoRefillController()"/>On

    <input type="radio" name="auto-refill" value="Off" onClick="dispatchCustomEvent()"/>Off
</form>

Questions
Did I access my controller correctly?

Any guidance is truly appreciated


texts:
I have file file controller

public function informationAction(){
    $data = $this->getRequest()->getPost();
    $id = (int)$data['courseId'];
    $modelCourse = Mage::getModel('course/courses')->load($id);
    $this->_redirect('course/manage/courses');
    return;
}

I want use ajax

var $j = jQuery.noConflict();
$j("#information-part").click(function(e){
    e.preventDefault();

    var courseId = $j('#courseId').attr('value');

    $j.ajax({
        type: "POST",
        dataType: "JSON",
        url: "http://hungnguyen-magento.local/course/manage/information",
        data: {
            courseId : courseId
        },
        success: function(response){
            var html = '';
            console.log(response);
        }
    });
});

How i can select data from controller?


texts: Import csv issue (product.php on line 1407)

texts:
I just install the magento 1.9.2 and try to import my csv file through System -> Import - > Import.

I received the following error message:

Notice: Undefined index: _attribute_set  in /app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php on line 1407

everything worked fine with the 1.9.1

any suggestion?

UPDATED

here is the code in line 1407 and 1408

if (!is_null($rowData[self::COL_ATTR_SET])) {
    $previousAttributeSet = $rowData[Mage_ImportExport_Model_Import_Entity_Product::COL_ATTR_SET];
}


texts: Remove html tags while exporting order.csv in Magento

texts: How can I remove html tags while exporting order.csv from magento admin panel. ?


texts: How to set custom attribute value in m2epro extension once order create in Magento admin Magento2

texts: I am using M2epro for Amazon and eBay. We want to set custom attribute value(static) once order creates in Magento admin. Can anyone have any idea how we can do it?


texts: Advanced attribute is not working in magento2

texts: I have created one custom product attribute as text field and that attribute is working fine and it's coming in product options. But i want to set one default text for all products, for that i have added Default Value in Advanced Attribute Properties ,but that value is not coming in that attribute option in product adding page.


texts:
I am learning Magento 2 and to put it into practice I want to develop a module.
Today by default Magento 2 registers Internet users on a single list, the idea would be to allow the visitor to choose for example to register just to receive: Promotions, blog ...
I want the lists to be able to be created from the backoffice.
I created a table and a page in the admin for the creation of the lists.

The idea is that a person who is subscribed to the newsletter (the default) is automatically subscribed to the new lists.
This is why I made the choice to create a column for those who are going to unsubscribe from the list and to enter their id in this field.
I overload the file: newsletter subscriber block.xml to add add this unsubscribe field.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="adminhtml.newslettrer.subscriber.grid.columnSet">
            <block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.newslettrer.subscriber.grid.columnSet.SubscribedNewslettersLists" as="SubscribedNewslettersLists">
                <arguments>
                    <argument name="id" xsi:type="string">name_list</argument>
                    <argument name="header" xsi:type="string" translate="true">Subscribed Newsletters Lists</argument>
                    <argument name="renderer" xsi:type="string">Ljr\ListTypesNewsletters\Block\Grid\Renderer\SubscribedNewslettersLists</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

And my file Ljr \ ListTypesNewsletters \ Block \ Grid \ Renderer \ SubscribedNewslettersLists :
class SubscribedNewslettersLists extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{
    protected $listNewslettersFactory;

    public function __construct(ListNewslettersFactory $listNewsletters)
    {
        $this->_listNewslettersFactory = $listNewsletters;
    }

    /**
     * Renders grid column
     *
     * @param   \Magento\Framework\DataObject $row
     * @return  string
     */

    public function render(\Magento\Framework\DataObject $row)
    {

        $listNewsletters = $this->_listNewslettersFactory->create()->getCollection();

        $resultat = '' ;

        foreach ($listNewsletters as $listNewsletter) {

            $unsubscribe = $listNewsletter->getUnsubscribe();

            $unsubscribe = explode (', ' , $unsubscribe);

            if (!in_array($row->getId(), $unsubscribe))
            {
                $resultat .= $listNewsletter->getNameList().', ';
            }
        }

        return $resultat;
    }
}

It works but not very effective. as the result is rendered by  it cannot be dynamic, for example for filters.
I find it complicated and in general it means that there is a better way to proceed but I lack experience :-(.
Can someone help me?
Thank you very much in advance


texts: magento 2.2. Community configuration DHL This shipping method is currently unavailable

texts:
I have already setting like this one.
and when I go to checkout on option shipping method there show

  This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.

on DHL option.

is that beacuse I did wrong configuration or what? because gateway url from DHL indonesia.

thanks in advance


texts:
When I first installed Magento 1.9.0.1 and activated Paypal Express Checkout, I saw the new style logo as shown on this page:

https://www.paypal.com/webapps/mpp/logos-buttons

But for reasons I can't explain my store now shows the old style logo, which in my opinion looks less modern.

The logo shown is this one:
https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecshortcut&locale=en_GB&ordertotal=29.95&pal=MOO

Anyone know why this could be?  I don't remember changing anything in the backend that would affect this?


texts: How to access configuration variables in magento checkout's javascript?

texts:
I am developing a magento custom payment method(gateway) and in order to redirect the user to the gateway I want to set on the checkout form to redirect to the custom gateways url with the coresponding parameters. So I created a custom controller action and want to redirect the user there so the POST data is created and from there to my custom gateways checkout page(http://somewhereonthenet.com).

The problem is that I do not know how to set the route or url for my action in the javascript so I can use it there. The javascript to redirect to my method is as follows:

/** Redirect to gateway */
continueToGateway: function () {
    if (additionalValidators.validate()) {
        //update payment method information if additional data was changed
        this.selectPaymentMethod();
        setPaymentMethodAction(this.messageContainer).done(
            function () {
                customerData.invalidate(['cart']);
                $.mage.redirect(
                    window.checkoutConfig.payment // Dont know what to put here and how to set it
                );
            }
        ;

        return false;
    }
}

And in the template it looks like this:

        <button class="action primary checkout" type="submit"
            data-bind="click: continueToGateway, enable: (getCode() == isChecked())"
            disabled>

        </button>

The code is working and it goes to the $.mage.redirect() but I do not know how to insert my module action url here.

So in this code I have to redirect to my custom action how to do that? Any help is appreciated.


texts: Load / Get a block outside of Magento routing for external use

texts:
I have an external webpage and I'm trying to pull the site header block from the Magento framework to use as a header in this external page. This is what I have so far:

// initialize Magento
$rootPath = dirname(dirname(__FILE__));
$mageInc = $rootPath . "/app/Mage.php";
include_once $mageInc;

Mage::app('admin')->setCurrentStore(0);

$headerBlock = Mage::app()->getLayout()->createBlock('page/html_header');
//also tried
//$headerBlock = Mage::app()->getLayout()->createBlock('page/html_header', 'header');

Execution stops there, however, and I get no error messages. My goal is to pull block Mage_Page_Block_Html_Header, which I think I can use to load <block type="page/html_header" name="header" as="header"> and all its contents from the page.xml layout file. That XML tag is wrapped inside

<default translate="label" module="page">
  <block type="page/html" name="root" output="toHtml" template="page/1column.phtml">

tags, so maybe I need to specify that somehow? I'm not sure what I'm doing wrong and where to go from here.


texts:
We have the following scenario to handle:

A customer orders a certain quantity of an item (let's say 20) to pick up in a specific store. Since we don't have live store inventories, there might be a back order (the store only have 15 of the 20). We invoice the customer when the store confirms that he picked some items for an order, but we only want to invoice the picked items (we do a partial invoice/payment). When a backorder happens, we want to contact the customer to offer him some solutions and one of them is that he can cancel the missing items and go in store to receive what was available. In that case, that means that we have an order of:

Order Quantity: 20
Invoiced Quantity: 15
Shipped Quantoty: 15

But the order remains "Processing" when in facts, it is complete. How can we complete this order without cancelling it because if the customer wants to return the items, we can't do it when status is cancelled? We would prefer being able to complete the order by keeping the quantities as is so we can report our Service Level.


texts: Patching process differences (OSX vs Debian / CE vs EE)

texts:
We've got 2 Magento sites, one is CE 1.7.0.2 and the other is EE 1.13.1.0. I can apply all of the CE site patches locally on my Mac without issue. When I try to apply the patches against the same codebase sitting on a Debian server, they fail with many "Hunk x FAILED at x" errors. I've compared the files against a vanilla Magento 1.7.0.2 installation using FileMerge and there aren't any differences. This is starting with the chronologically first patch and occurs on every patch through the latest 7405 and 7616 patches. That rules out the problem being that previous patches weren't applied.

HOWEVER

I'm not having issues applying the EE versions of these patches to our EE site in our Debian environment.

Any idea what the problem could be? At first I thought it could be the patch scripts detecting some kind of hidden line ending or character return differences that are missed/ignored on OS X. Finding that I'm not having the same issue on the EE site kind of squashes that theory.


texts:
I've exported my customers to a CSV file. The problem is, that the _address_street has the first line of the address as well as the suburb, merged into one?

Is that normal? Is there a field for address line 2?

I'm using Magento 1.9

I tried to actually reimport that data back into Magento...and it forced everything into Address Line 1.


texts:
A while ago I created a simple blog addon for Magento. Due to neeidng isotope it was kept simplistic.

However a while later it appears that the sort order isn't quite working. In both the backed and on the front end sorting by date is... weird.

I click on the date fiel in the back end to sort descending, and I get aug 13, jul 12, apr13 and so on. While this is all fine ad it has no impact on the front end is is worrying.

The front end however is following these queer dates. Here is the code I'm using to get the model and sort by date:

<?php $posts = Mage::getModel('blog/blog')->getCollection()->setOrder('date', 'DESC'); ?>

From what I can tell it's working, but its sorting by these weird dates. Could this
have been caused by a user manually typing in dates and not using a date picker?

One splution I can see is adding an "order" field to the module, however I used a module creator (http://www.silksoftware.com/magento-module-creator/) to build it and previously had a horrible time with updating modules and currently there is no dev version of the site I'm working on due to it's now grown size so I'm having to do small changes to a live version (yes horrible idea I know).

It's been so long since I made any modules for Magento and I really can;t think of where to start for debugging this so any help would be appreciated.


texts: 403 Forbidden on saving admin configuration in Magento 2.2.2

texts:
Getting 403 Forbidden error while saving the Admin Catalog -> Catalog configuration only. Remaining all configurations are saving without any error.

And also, When Save/Update the products which are having product images are also leads to 403 error. The Products which doesn't have Images are updating well.

I have verified Folder and File Permissions and those are have 755, 644 respectivly.

Can any one help me to solve this issue?


texts: Delete multiple store views programmatically

texts:
I am trying to delete multiple store views using a php script that includes app/Mage.php in the root of my installation.

I am able to get the list of websites and store views but I need to somehow parse them into the delete() method as an array the loop over each store_id in order to delete the ones I no longer need.

Also, I need to find a way to filter the store_id so that I don't remove the default store view or admin.

Here is what I have so far:

/** Load Magento **/
umask(0);
require_once 'app/Mage.php';

/** Load webstes and stores */
echo "Website ID: " . Mage::app()->getWebsite()->getId() . "
";
echo "Website Name: " . Mage::app()->getWebsite()->getName() . "
";
echo "Store ID: " . Mage::app()->getStore()->getId() . "
";
echo "Store Name: ".Mage::app()->getStore()->getName(). "
";
echo "Store code: ". Mage::app()->getStore()->getCode()."
";

/** @var ** $website loop */
foreach (Mage::app()->getWebsites() as $website) {
    foreach ($website->getGroups() as $group) {
        $stores = $group->getStores();
        foreach ($stores as $store) {
            echo $store->getId() ." ".$store->getName()."
";
        }
    }
}
/** ** End of script */

I'm haven't been able to find a way to call the delete() method foreach store_id using:

$model = Mage::getModel('core/store')->load($stores);
$model->delete();

Can anyone help?


texts: Values doesn't override in magento using soap api from external php site duplicacy issue

texts:
this is my code

<?php
$servername = "localhost";
$username = "username";
$password = "mypasswrd";
$dbname = "dbname";
$conn = new mysqli($servername, $username, $password, $dbname);
$client = new SoapClient('myurl');
$session = $client->login('usr', 'pswrd');
// get attribute set
$attributeSets = $client->call($session, 'product_attribute_set.list');
$attributeSet = current($attributeSets);
$query="select * from stock";
 $resultt=mysqli_query($conn,$query);
        if($resultt->num_rows > 0)
          {

         while($row=mysqli_fetch_assoc($resultt))
          {
       $name=$row['stock_name'];
     $result = $client->call($session, 'catalog_product.create', array('simple', $attributeSet['set_id'], rand(), array(
    'categories' => array(2),
    'websites' => array(1),
    'name' => $name,
    'description' => 'Nyc one',
    'short_description' => 'nyc tt',
    'weight' => '10',
    'status' => '1',
    'url_key' => 'product-url-key',
    'url_path' => 'product-url-path',
    'visibility' => '4',
    'price' => '1000',
    'tax_class_id' => 1,
    'meta_title' => 'Product meta title',
    'meta_keyword' => 'Product meta keyword',
    'meta_description' => 'Product meta description'
)));
          }
          }
          else
          {
         echo "fail";

          }
var_dump ($result);
$conn->close();
?>

how to match the product name of my external table with product name of a magento table?


texts: Magento 2: Checkout Payment Method Render List

texts: How do I / how does Magento trigger the payment method's list renderer to display the available payment methods? I'm updating my checkout and would like to display the payment methods after some conditions have been met.


texts: Allow tinytext in db_schema.xml magento 2

texts:
I'm doing a custom migration from Magento 1.9 to Magento 2.3.4 , in one of the custom module on Magento 1.9 it uses tinytext as table column type, therefore I tried to recreate this module using tinytext too in order successfully migrate the data without causing incompatible database table column type.

<column name="short" nullable="true" xsi:type="tinytext"/>

but I always got an error like this:

  Element 'column', attribute
  '{http://www.w3.org/2001/XMLSchema-instance}type': The QName value
  'tinytext' of the xsi:type attribute does not resolve to a type
  definition.


texts:
Magento site is frequently getting CACHE issue and failing to serve CSS, site is getting broken page.

Once after flush redis cache or restart of redis is bringing site into normal position.

Below cache technologies being integrated for magento web site.

Magento: 1.9.1.0
Redis: 3.0.5
Lesti FPC

Server  have two redis instance running with Port No: 6379 and 6380

Site is configured with redis cache for magento backend and full page cache (FPC site cache), Redis's 6379 instance is configured for both cache setup but redis database are different.

Configurations as below:

backend redis configurations in local.xml

[![<cache>
<backend>Cm_Cache_Backend_Redis</backend>
            <backend_options>
                <server>127.0.0.1</server>
                <port>6380</port>
                <persistent>cache-fpc</persistent>
                <database>1</database>
                <password></password>
                <force_standalone>1</force_standalone>
                <connect_retries>1</connect_retries>
                <lifetimelimit>86400</lifetimelimit>
                <read_timeout>10</read_timeout>
                <compress_data>1</compress_data>
                <compress_tags>1</compress_tags>
                <compress_data>gzip</compress_data>
            </backend_options>

</cache>][1]][1]

FPC site cache redis configurations in fpc.

    <fpc>
            <lifetime>86400</lifetime>
<backend>Cm_Cache_Backend_Redis</backend>
            <backend_options>
                <server>127.0.0.1</server>
                <port>6380</port>
                <persistent>cache-fpc</persistent>
                <database>1</database>
                <password></password>
                <force_standalone>1</force_standalone>
                <connect_retries>1</connect_retries>
                <lifetimelimit>86400</lifetimelimit>
                <read_timeout>10</read_timeout>
                <compress_data>1</compress_data>
                <compress_tags>1</compress_tags>
                <compress_data>gzip</compress_data>
            </backend_options>
</fpc>

Scheduled redis cache clearing cronjob as per this reference URL: http://inchoo.net/magento/using-redis-cache-backend-and-session-storage-in-magento/


texts: Add custom field to product media gallery

texts:
I'm completely new to Magento, and I'm using Magento 2 as a backend api (graphql). I want to add custom field tag checkbox or anything to media information to filtering and showing them on custom porfolio gallery at the front-end.

Where should I get start?

I were tried to add new role, but only one role can be picked for a media at a time.


texts: How to create dynamic product image in Magento 2 on creating Product?

texts:
I have created a module to create simple product in Magento 2.
I want to create dynamic image for product with product name and save that image as product image.
How would i do that ?
Any Help is appreciated.


texts: Magento 2: How to get value from attribute from store_id 0 (admin/unique)?

texts:
I'm trying to get store label for admin (store 0 - zero) but since I have something in "Default Store Label" I'm getting only that value. I need to find the solution to get always only the admin (unique) value. If solution will be like override/plugin for core - that will be applicable too.

Code which I'm using:

//($this->attributeOptionManagement = \Magento\Eav\Api\AttributeOptionManagementInterface)

$existingOptions = $this->attributeOptionManagement->getItems(Product::ENTITY, $attributeCode);
foreach ($existingOptions as $existingOption) {
    $this->existingOptions[$attributeCode][] = $existingOption->getLabel();
}

So if I have this:

I will have this output based on my code:

Array
(
    [0] =>
    [1] => Black
    [2] => Charcoal
    [3] => Cream
    [4] => Gray
    [5] => Green
    [6] => Lightning
    [7] => Natural
    [8] => Olive
)

And if I have this:

The output will be like that:

Array
(
    [0] =>
    [1] => BLACK
    [2] => CHARC
    [3] => CRBBL
    [4] => GR/NA
    [5] => GYCHR
    [6] => LTHTG
    [7] => NATUR
    [8] => OLIVE
)


texts:
I am using below code to get customer id by email

use Magento\Customer\Model\Session;

protected $_objectManager;
protected $currentCustomer;
protected $_customer;
protected $_storeManager;
 public function __construct(
    Session $customerSession,
    \Magento\Customer\Model\CustomerFactory $customer,
    \Magento\Framework\ObjectManagerInterface $objectmanager,
    \Magento\Store\Model\StoreManagerInterface $storeManager
)
{
    $this->session = $customerSession;
    $this->_customer = $customer;
    $this->_objectManager = $objectmanager;
    $this->_storeManager = $storeManager;
}

 public function execute()
{
  $email = 'test@gmail.com';
 $customerModel = $this->_objectManager->create('Magento\Customer\Model\Customer');
        $storeId = $this->getWebsiteId();
        $customerModel->setWebsiteId($storeId);
        $customerModel->loadByEmail($email);
        $userId = $customerModel->getId();
 }
 public function getWebsiteId(){
   return $this->_storeManager->getStore()->getWebsiteId();
}

I am not getting customerid, Please anyone suggest me, how to get customer id by email.


texts:
I have created a custom entity table vaibhav_customtabs_product_entity, where I have following columns.

entity_id
entity_type_id
attribute_set_id
increment_id
store_id
created_at
updated_at
is_active
product_id (entity_id from 'catalog_product_entity')

Now my question is how do I join catalog_product_entity & vaibhav_customtabs_product_entity tables, based on the product entity id. So that, I can fetch the attribute value from my custom entity.
Also from both the entity.


texts: "Database connection error" when installing 1.7.0.2 on Ubuntu

texts:
I'm installing Magento version 1.7.0.2 on an Ubuntu VM, hosted in Azure - I'm getting "Database connection error" in the Magento Installation Wizard.

I've installed PHP & MySQL as instructed here.
In mysql, I've granted access to a userx, which is the same one entered in the wizard.

Other threads suggested (and I tried):

Replacing "localhost" with "127.0.0.1" - didn't help
Installing "InnoDB" - Mysql says it is default

EDIT - These are the modules I've installed:
sudo apt-get install apache2
sudo apt-get install php5 libapache2-mod-php5
sudo apt-get install php5-mysql
sudo apt-get install php5-curl php5-mcrypt php5-gd php5-common
sudo apt-get install mysql-client mysql-server


texts: Why does magento need so much time to update a css change?

texts:
I always have to waits some minutes to see changes after I edited my css file. What can causes this and how can I fix this? Thank you.

Edit: I disabled all caches and I always refresh browser cache.


texts:
We have about 68 000 disabled products in our database. We need somehow to delete all disabled products from the shop. The normal Magento's delete product process in the admin does not work as it gets interrupted by the server (time exceeded on a shared host).

Also tried with product import and it's deleted option, but that too gets interrupted. Also tried Magmi with the same result. The problem might be related to reindexing that takes a long time, but not sure.

Just wondering if there is a safe way to delete all disabled products via SQL? Or would there be another way to automatically delete products one by one?


texts: Magento 2.2.2 On product save i get error ''Invalid Form Key. Please refresh the page'

texts:
I add some custom option in sample product. I save this product and add changes in custom option.
But I can not save the product. and get this error,

Invalid Form Key. Please refresh the page.


texts: Change _beforesave in Sales EntityAbstract

texts:
In Magento 2.2.6 they "fixed" an error, all invoices had the sequence number of the default store. This worked out for us because we need the invoices for all storeviews in a single sequence for Tax purposes.

The change was made in the file magento\module-sales\Model\ResourceModel\EntityAbstract.php

Now I want to revert this change without altering the Core Code.
The code I want to use is: (From Magento 2.2.5)

    protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
{
    /** @var \Magento\Sales\Model\AbstractModel $object */
    if ($object instanceof EntityInterface && $object->getIncrementId() == null) {
        $object->setIncrementId(
            $this->sequenceManager->getSequence(
                $object->getEntityType(),
                $object->getStore()->getGroup()->getDefaultStoreId()
            )->getNextValue()
        );
    }
    parent::_beforeSave($object);
    return $this;
}

Now I tried Various options using my own Module with preference setting is the di.xml  but I can get it to work.  Magento only uses the original code and not the one I want it to use.

For Now I changed the Magento 2 Core Code but this is not the right way.

Any thoughts on this?  I'm really stuck.


texts: where is newly created page located in magento 2.0

texts:
Iam very new to magento.
I have created a new page in magento using admin.
and the url is working fine.
but, can I see the file created for my new page.
I have to add code in it. I dont know where it located.

what are the files created when a new page created?

Thanks in advance


texts: Magento 2 - Changing the PayPal logo on the Checkout page

texts:
I am trying to change the PayPal logo that appears on the checkout page, just before the customer is forwarded to PayPal to make a payment. Here is a screenshot:

I looked everywhere and tried to change the file below:

./vendor/magento/module-paypal/view/frontend/templates/payment/mark.phtml

Still no joy. Any help or guidance will be appreciated!


texts: Want to rewrite core Helper class (Mage::helper('core'))

texts:
i want rewrite magento helper core class Mage_Core_Helper_Data.
I have try below code, but it is not working

<?xml version="1.0" ?>
<config>
    <global>
            ...
        <helpers>
            <csscompresser>
                <class>Amit_CssCompresser_Helper</class>
            </csscompresser>
            <core>
                <rewrite>
                    <data>Amit_CssCompresser_Helper_Core_Data</data>
                </rewrite>
            </core>
        </helpers>
        ...
    </global>
<config>

Can any one tell why is not working?


texts: free bannerslider extension compatable in magento 2.1.6

texts: Is ther any free banner slider extension compatable for magento 2.1.6.If please share me the link.


texts: Related Products Trick: A -> B && B -> A

texts:
Let's say I have 100 products.

Product Number 6 has 15 related products.

These 16 products (15 plus Product Number 6) should all be related to each other.

Is there a method or extension that allows me to have the selected products automatically related to each other?

I asked this question and don't really understand if this can be done with my scenario.


texts: Withdraw tax of a product if its price is above 7?

texts: I want to withdraw tax of a product if its price is above 7 . How can I do that? I tried price rules and tax rules. But unfortunately failed to figure it out. please share if you know.


texts: Even after Adding Form Key in phtml Magento 2.3 shows invalid form key error often

texts: I added Form key in all forms. But in some forms still, I am getting Invalid form key Please refresh error often. How to solve this? Is I need to add further things to solve this? Kindly help me.


texts: Fetch data from table customer_entity_varchar in Mage_Adminhtml_Block_Sales_Order_Grid class

texts:
I'm trying to add a new column to the sales order grid in the admin panel.

I have created the file

app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php and extended the

class Mage_Adminhtml_Block_Sales_Order_Grid in the file.

I have the class setup and extending works good, as I've managed to retrieve sales_flat_order_address.postcode as a column but I want to also add a column to the grid that is a custom customer attribute.

I can see this custom customer attribute in the table customer_entity_varchar but I have no idea how I get that data in to the _prepareCollection() function within

app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php


texts: show SKU in Product view only from simple products

texts:
I think its easy but i don't found a way. In the product view.phtml ,I want to show the SKU. But only for simple Products. Is there any Way like this:

<?php echo $_helper->productAttribute($_product,$_product->getSku()->addAttributeToFilter('type_id', 'simple'), 'sku') ?>

This way don't work.


texts: I am unable to login to site and the admin e.g.example.com/admin due to ERR_TOO_MANY_REDIRECTS error

texts:
I am unable to login to site and admin in my website e.g. example.com/admin due to  ERR_TOO_MANY_REDIRECTS error.

This page isn’t working
    example.com redirected you too many times.
    Try clearing your cookies.
    ERR_TOO_MANY_REDIRECTS

I am using Amazon Lightsail host. How do I access admin using localhost , creating a tunnel, like the one for PHPMyAdmin? This is not using my domain name.


texts: Magento 2 : How to Update cart after cart update event (checkout_cart_update_items_after)

texts:
I am trying tho again update cart after update cart action(when cart qty is updated from cart page Or from miniCart) and change the qty if some cases

$mappedProductSkus= $this->_helperData->getSku();
        $cartData=[];
        foreach($quote->getAllVisibleItems() as $item)
        {
            $productSku=$item->getSku();
            $productAdded = $this->_productRepository->get($productSku);

            if(in_array($productSku, $mappedProductSkus ))
            {
                $itemQty= $item->getQty();
                $allocatedQty = $this->_helperData->finalQty($productSku,$itemQty);
                $itemId= $item->getId();
                $cartData[$itemId]['qty'] = $allocatedQty;
                if($allocatedQty<$itemQty){
                    $this->_messageManager->addNoticeMessage('Max Qty of '.$allocatedQty.' can be added to cart for'.$productAdded->getName());
                }
            }
            else
            {
                $itemId= $item->getId();
                $cartData[$itemId]['qty'] = 1;
                if($item->getQty()>1){
                $this->_messageManager->addNoticeMessage('Only one item can be bought at a time );
                }
            }
        }
        $cartData = $this->_cart->suggestItemsQty($cartData);
        $this->_cart->updateItems($cartData)->save();

But as we call updateItems it again triggers checkout_cart_update_items_after and the code goes in infinite loop

event.xml

<event name="checkout_cart_update_items_after">
        <observer name="checkbeforeupdate" instance="Fleetguard\Inventoryrationing\Observer\Checkbeforeupdate" />
    </event>


texts: Change home page category block style CSS

texts:
I have home page with categories showing very well but now I have to make some design related changes to show category without title and blocks with lines as box.

Current:

Desired style:

Let me guide how to change category grid layout using css


texts: How to create customer custom attribute for radio buttons, checkbox in magento 2

texts:
I wish to create customer custom attributes with following types:
1.radio buttons
2.checkbox
3.dropdowns

Please provide me a solution to create customer custom attribute.


texts:
I am working on PayPal subscription recurring when I add 2 product in my cart 1 is simple and other is subscription and place an order using this calls

if ($product->getCryozonicSubEnabled())
            {
                $interval = ucfirst($product->getCryozonicSubInterval());
                $intervalCount = $product->getCryozonicSubIntervalCount();

                $api->callCreateRecurringPaymentsProfile($interval,$product->getName(),$intervalCount);
            }
             if (!$product->getCryozonicSubEnabled())
            {
                $api->callDoExpressCheckoutPayment($data);
            }

the problem is that in paypal both product in payment and recuring also creating.


texts: Order Status after creditmemo is complete for order with 0.00 total

texts:
There is no creditmemo button showing in magento order with total paid amount is 0 after applying discount.

For this I changed canCreditmemo() function in app/code/local/Mage/Sales/Model/Order.php .

From :

...
if (abs($this->getStore()->roundPrice($this->getTotalPaid()) - $this->getTotalRefunded()) < .0001) {
                return false;
            }
...

To :

...
if (abs($this->getStore()->roundPrice($this->getTotalPaid()) - $this->getTotalRefunded()-$this->getDiscountAmount()) < .0001) {
                return false;
            }
...

After that in order Creditmemo button showing, creditmemo create successfully, product qty also refunded in magento store.

But after create creditmemo of all products then order status should be closed but in this case order status still complete.

How to change order status to closed for that order?


texts: Remove the "category product" from category edit

texts:
I am developing social network project in magento, so i like to remove the all product related things from the magento admin.

How to remove the "category product" from the category edit page.


texts: Magento 2: How to display text in one line product catalog

texts:
I added the text before the price in list.phtml, here is my code:

<?php /* @escapeNotVerified */ echo __('Retail price:') ?><?php echo $block->getProductPrice($_product) ?>

Only I can not display it in one line in any way. Can anyone help?

I want to display in one line:
Retail price: 125,00 zł 100,00 zł

@ update result

is correct in one line but still now no display price

@ update 2


texts:
I'm on the product page and in my layout i created a block to render on the product informations, on the upsell product informations and on the related product informations but it doesn't works.

The problem is caused because my block has multiple childs to render and in layouts i see that if a block has the same name it doesnt works

ex:

<referenceBlock name="foo">
    <block class="..." name="something">
        <block class="..." name="athing"/>
    </block>
    <block class="..." name="something else">
        <block class="..." name="athing.else"/>
    </block>
</referenceBlock>
<referenceBlock name="baz">
    <block class="..." name="something">
        <block class="..." name="athing"/>
    </block>
    <block class="..." name="something else">
        <block class="..." name="athing.else"/>
    </block>
</referenceBlock>
<referenceBlock name="bar">
    <block class="..." name="something">
        <block class="..." name="athing"/>
    </block>
    <block class="..." name="something else">
        <block class="..." name="athing.else"/>
    </block>
</referenceBlock>

How i need to organise this ? Should i put a prefix before each name and put an "as" property (like bellow) ?

<referenceBlock name="foo">
    <block class="..." name="foo.something" as="something">
        <block class="..." name="foo.athing" as="athing"/>
    </block>
    <block class="..." name="foo.something.else" as="something.else">
        <block class="..." name="foo.athing.else" as="athing.else"/>
    </block>
</referenceBlock>
<referenceBlock name="baz">
    <block class="..." name="baz.something" as="something">
        <block class="..." name="baz.athing" as="athing"/>
    </block>
    <block class="..." name="baz.something.else" as="something.else">
        <block class="..." name="baz.athing.else" as="athing.else"/>
    </block>
</referenceBlock>
<referenceBlock name="bar">
    <block class="..." name="bar.something" as="something">
        <block class="..." name="bar.athing" as="athing"/>
    </block>
    <block class="..." name="bar.something.else" as="something.else">
        <block class="..." name="bar.athing.else" as="athing.else"/>
    </block>
</referenceBlock>


texts:
I just recently migrated our database from Magento 1.6.1 to Magento 2.3.3 now everything seems OK but after testing all functionality I found out that whenever I add a product in the cart it says that the product is not available even though I know that there are quantities for this product below is how my product grid looks like

As you can see in the Salable Quantity it says No manage stock now when I check the actual product here is the content

As you can see the Quantity of the product is still 500 but when you look at the Salable quantity tab. There is no value.


texts: Is there a way to replace a breadcrumb link with a specific url? (M2.1.9)

texts:
So I have a Magento Open Source 2.1.9 site that for the most part is working however, we have started to create several landing pages for our root categories, and they work great. For example: We have a landing page for Automotive Parts.
One of the links from that landing page is for exhausts. If someone clicks on Exhaust, the breadcrumbs show up as:

home > automotive parts > exhausts

The problem is that if they click on the automotive parts link, it brings them to that categories page, NOT the landing page.  Is there a way to either A) Replace the category page with a permanent link to the landing page (I've tried a url-rewrite, but it doesn't seem to work), or B) replace the breadcrumb link to the automotive parts landing page.


texts: Show WYSIWYG button below custom category attribute

texts:
I added category attribute (textarea) and Magento stops displaying WYSIWYG button if I use custom renderer for that textarea field. I want to ask I anyone knows why this happens?

Here are my steps. I added category attribute, a simple textarea with WYSIWYG button:

$installer->addAttribute('catalog_category', 'my_attr1', array(
    'label'             => 'My attribute 1',
    'type'              => 'text',
    'input'             => 'textarea',
    'visible_on_front'  => true,
    'wysiwyg_enabled'   => true,
    'is_html_allowed_on_front' => true,
    'visible'           => true,
    'required'          => false,
    'backend'           => '',
    'frontend'          => '',
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

All works correct, WYSIWYG button is displayed below the field.

Then I added second attribute my_attr2 to make some tests. That second attribute use my custom renderer class (see 'input_renderer' => 'my_custom') because I need to extend that field with additional functionality. I checked that attribute was added correct and works 100% correct. That class My_Custom extends Magento's default textarea renderer Varien_Data_Form_Element_Textarea so it looks and works exactly the same as standard textarea field.

But for some reason Magento stops displaying WYSIWYG button if I use custom renderer.

$installer->addAttribute('catalog_category', 'my_attr2', array(
    'label'             => 'My attribute 2',
    'type'              => 'text',
    'input'             => 'textarea',
    'input_renderer'    => 'my_custom', //<---custom
    'visible_on_front'  => true,
    'wysiwyg_enabled'   => true,
    'is_html_allowed_on_front' => true,
    'visible'           => true,
    'required'          => false,
    'backend'           => '',
    'frontend'          => '',
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

Here's the rendered class (located in file lib/My/Custom.php).
I checked that Magento for sure use this class when rendering the second attribute (I added logging to the constructor to make sure it works).

<?php
class My_Custom extends Varien_Data_Form_Element_Textarea
{
    public function __construct($attributes=array())
    {
        parent::__construct($attributes);
        Mage::log("My_Custom is working");
    }
}

Even If I remove all the code from the renderer class lib/My/Custom.php to make sure I didn't break or override anything, the WYSIWYG button is still not displayed below the second attribute:

<?php
class My_Custom extends Varien_Data_Form_Element_Textarea
{
}

And as soon as I update my_attr2 and remove the custom renderer class, then the WYSIWYG button is displayed correct below the textarea (just like it should be).


texts: How to use custom variables in Product descriptions?

texts:
Many products need to have the same or partly the same description, in order to be able to edit them all at once it would come in handy to make use of the magento custom variables. They work in CMS blocks but I was not able to make them show their contend in product descriptions.
Is there a way to achieve this without reinventing the wheel?


texts: Magento 2: what is the difference between collection and collectionfactory?

texts: What is the difference between the collection and collection factory?


texts:
even after enabling the module using command-line
the modules content are not loading,

in app/etc/config.php it sets the value as one    'Turtle_VM' => 1,

but in local system and staging the module is working fine

i run the following command to enable the module:

php bin/magento module:enable Turtle_VM
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile


texts: Session Message Redirect in seperate function

texts:
before redirecting I set an errormessage on the session like this

    Mage::getSingleton('core/session')->setError('ERROR::Please enter all fields');
    session_write_close();
    $this->_redirect('*/*/');
    return;

This works jsut fine but if I do that from a seperate methods the message is not set to the session

e.g

protected function _RedirectWithError($errorMessage)
    {
        Mage::getSingleton('core/session')->setError('ERROR::' + $errorMessage);
        session_write_close();
        $this->_redirect('*/*/');
        return;
    }

somewhere else:
    $this->_RedirectWithError("foobar");
    return;

I wonder why the session message is not working in this case?

Thanks


texts: How to control where your template gets displayed on a page?

texts:
If I want to display my template file AFTER the "Add to Cart" button on every product view page, but it gets displayed at the bottom of page content?

<layout>
    <catalog_product_view>
        <reference name="content">
            <block type="test_example/example" name="product.example" after="product.info.addtocart" template="test/example/view.phtml"/>
        </reference>
    </catalog_product_view>
</layout>

I have tried many different after="product.info.addtocart" by searching for layout block names in files, but everything gets displayed at the bottom of page content no matter what.


texts: Notice: unserialize(): Error at offset 0 of 94 bytes Magento 2.2.5 when update wishlist

texts:
I am getting an error {"0":"Notice: unserialize(): Error at offset 0 of 94 bytes in. \Model\Item.php When update wishlist from wishlist page. I am using Magento 2.2.5

I already try this solution and this solution worked for add all cart from wishlist. but not working when update list.

Tried solution Link: Notice: unserialize(); Error at offset in Magento 2.2


texts: Magento 2: How to create new customer cart via rest API?

texts:
I want to place an order for a customer from API. Currently, I do:

Login as integration (OAuth).
Create customer
Create customer cart (or take an existing one).
Remove all items from the cart.
Add items to the cart.
Place order.

A customer may have only 1 active cart. I must use the customer cart from Magento and remove the customer's products from his cart. This is not good.

How can I use the cart without touching an existing customer cart?


texts: Calling block from phtml gives an error [Solved]

texts:
The error that I'm getting is :

  Fatal error: Cannot declare class ExpectedDelivery, because the name
  is already in use in
  /var/www/html/app/code/Fabelio/Checkout/Block/ExpectedDelivery.php on
  line 89

I called the block in my html like this :

<?php
    $this->getLayout()->createBlock('Fabelio\Checkout\Block\ExpectedDelivery');
?>

and here is the Block class :

class ExpectedDelivery extends \Magento\Framework\View\Element\Template
{

    protected $todoItemFactory;
    protected $sessionCustomer;
    protected $sessionCheckout;

    /**
     * ExpectedDelivery constructor.
     * @param Template\Context $context
     * @param Session $session
     * @param array $data
     */
    public function __construct(
        Template\Context $context,
        Session $sessionCustomer,
        SessionCheckout $sessionCheckout,
        array $data = [])
    {
        $this->sessionCustomer = $sessionCustomer;
        $this->sessionCheckout = $sessionCheckout;
        parent::__construct($context, $data);
    }

    function _prepareLayout(){
    }

    public function getExpectedDelivery()
    {
        return 'goodbye magento 2';

    }
}

Any idea how to call the block the right way in magento 2.1.8 ?

Solve : The problem here is because of I forget to add the namespce Fabelio\Checkout\Block; in the Block class. Thanks everyone.


texts: Cronjob - shorter intervals than 5 minutes

texts:
Is it feasible to run the Magento cron (on Linux) at a  shorter interval than 5 minutes? It seems that every resource I find seems to recommend 5 minutes.

The reason is that I have an auto invoice generating module which means the customer needs to wait 5 minutes before an invoice is generated.

This is not an observer triggered code that is hooked up to an event, but it's a process handled by the internal Magento cron tab.

Has anyone had any issues with 1 or 2 minutes? Are ther performance implications?


texts: Magento Catalog Product Images are not showing

texts:
Magento2 Catalog Product Images are not showing. All was working good on localhost.

But when i move all files on server after that product images are not showing on frontend.

Please check this link http://kiegeszitoshop.hu/men/tops-men/jackets-men.html

Can anyone please help me??


texts: Is there a way to Sort Comments History by Descending order?

texts:
This might seem like a silly questoin so I apologies if it does but I am looking to change the Sort order for Comments history in Magento Sales/Order_View Comments History Tab.

Currently the Comments are listed in Ascending Order but I would like to list them in Descending order without having to touch any Core files of course...

The question I would like to as is Where? and How?

Thanks in advance...


texts: Default title doesn't show , instead shows homepage title

texts:
I am unable to figure out why the default title doesn't show on my page title. The page title is instead displaying the name of the cms home page. How do I stop displaying the page name?
Here's the screenshot & link to the site.


texts: Magento 2.1.2 "Invalid option value" when importing configurable products

texts:
I'm trying to import configurable products into Magento 2.1.2. I have already imported the simple products.

When trying to import the configurable products, it seems to happen randomly. In total I have 1930 rows, but the above issue only occurs with 623.

So far, I have:

Checked the configurable_variations exist
The imported products have a quantity above 0
The products are enabled
Checked all error logs - no related entries.
Encoded the .csv in UTF-8-BOM

What is causing this issue? Or where can I find more data to try and solve it?

Here is an example of what I'm trying to import, saved as a .csv:

https://ufile.io/6a45

Thanks for your time!

Edit: I can provide .csv entries in plain text, they are very long so I didn't include initially.