texts: Remove title New Products from Magento 2 Content New Products Widget

texts:
I have scoured the internet looking for a solution of removing the title word New Products that exists just above the grid from the Magento 2 new products content widget.

Not sure how to accomplish this. I've seen lots of information about changing xml templates but i'm not skilled enough in Magento to understand what they are saying.


texts: Magento 2: New order email totals/subtotal decimal places

texts:
we have changed our site to display prices in 4 decimal places using this extension

However on the new order email we would like to trim off the extra zeros. This is how it is displaying...

Subtotal £15.2500

Shipping & Handling £7.5000

Tax £4.5500

Grand Total £27.3000

I think these are being added to the email via this

vendor/magento/module-sales/view/frontend/templates/order/totals.phtml

<?php foreach ($block->getTotals() as $_code => $_total): ?>
<?php if ($_total->getBlockName()): ?>
    <?php echo $block->getChildHtml($_total->getBlockName(), false); ?>
<?php else:?>
<tr class="<?php /* @escapeNotVerified */ echo $_code?>">
    <th <?php /* @escapeNotVerified */ echo $block->getLabelProperties()?> scope="row">
        <?php if ($_total->getStrong()):?>
        <?php echo $block->escapeHtml($_total->getLabel());?>
        <?php else:?>
        <?php echo $block->escapeHtml($_total->getLabel());?>
        <?php endif?>

    <td <?php /* @escapeNotVerified */ echo $block->getValueProperties()?> data-th="<?php echo $block->escapeHtml($_total->getLabel());?>">
        <?php if ($_total->getStrong()):?>
        <?php /* @escapeNotVerified */ echo $block->formatValue($_total) ?>
        <?php else:?>
        <?php /* @escapeNotVerified */ echo $block->formatValue($_total) ?>
        <?php endif?>

<?php endif?>

Which is controlled (I think) by this...

vendor/magento/module-sales/Block/Order/Totals.php

Can we format the totals here?

Thanks


texts: How can add filters in custom grid magento 2 without UI component

texts:
I have created a custom grid for reports in the admin without UI component. Now I want to add filters in the grid. Filters type Date-Range, Price-Range, Status.
<?php
        protected function _prepareColumns() {
        $this->addColumn(
                'increment_id',
                [
                    'header' => __('Increment ID#'),
                    'index' => 'increment_id',
                ]
        );

        $this->addColumn(
                'order_id',
                [
                    'header' => __('Order #'),
                    'index' => 'order_id',
                ]
        );

        $this->addColumn(
            'created_at',
                [
                    'header' => __('Purchased On'),
                    'index' => 'created_at',
                ]
        );

        $this->addColumn(
            'amount_payable',
                [
                    'header' => __('Actual Amount Paid'),
                    'index' => 'amount_payable',
                ]
        );

        $this->addColumn(
            'amount_pay_later',
                [
                    'header' => __('Balance Payment'),
                    'index' => 'amount_pay_later',
                ]
        );

        $this->addColumn(
                'grand_total',
                [
                    'header' => __('Grand Total'),
                    'index' => 'grand_total',
                ]
        );

        $this->addColumn(
                'status',
                [
                    'header' => __('Status'),
                    'index' => 'status',
                ]
        );

        $this->addColumn(
                'method',
                [
                    'header' => __('Payment Method'),
                    'index' => 'method',
                ]
        );

        $this->addColumn(
                'billing_name',
                [
                    'header' => __('Bill to Name'),
                    'index' => 'billing_name',
                ]
        );
        $this->addColumn(
                'shipping_name',
                [
                    'header' => __('Ship to Name'),
                    'index' => 'shipping_name',
                ]
        );

        $this->addExportType($this->getUrl('custom/*/exportCsv', ['_current' => true]), __('CSV'));
        $this->addExportType($this->getUrl('custom/*/exportExcel', ['_current' => true]), __('Excel XML'));

        $block = $this->getLayout()->getBlock('grid.bottom.links');
        if ($block) {
            $this->setChild('grid.bottom.links', $block);
        }

        return parent::_prepareColumns();
    }
?>


texts:
I have to Apply certain patch to Magento 1.9.4.5, but i can't find it anywhere.
Security patch 11219
Security patch 11155
Security patch 8788


texts:
I have upgraded my Magento 2.2.8 website to 2.3.5. The system used the Ves theme. But currently, the Ves theme doesn't have the latest theme module for Magento 2.3.5. Ves theme used landcooder page builder and Megamenu. so I have directly purchased the module and integrated it into my system. After compilation. Admin megamenu edit page shows an error of
Fatal error: Uncaught Error: Call to a member function processGalleryConfig() on null : vendor/magento/module-cms/Model/Wysiwyg/Config.php:209

From my findings, I have added below code on mega menu di.xml file
<type name="Magento\Cms\Model\Wysiwyg\CompositeConfigProvider">
    <arguments>
        <argument name="variablePluginConfigProvider" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Variable\Model\Variable\ConfigProvider</item>
        </argument>
        <argument name="widgetPluginConfigProvider" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Widget\Model\Widget\Config</item>
        </argument>
        <argument name="wysiwygConfigPostProcessor" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Cms\Model\Wysiwyg\DefaultConfigProvider</item>
        </argument>
        <argument name="galleryConfigProvider" xsi:type="array">
            <item name="default" xsi:type="string">Magento\Cms\Model\Wysiwyg\Gallery\DefaultConfigProvider</item>
        </argument>
    </arguments>
</type>

But same issue exist. so could please help me to sort out this issue.


texts:
I have a running store with around 600 products and wanted to remove the HTML suffix from my URLs.

I removed the HTML in the config and reindexed. All HTML pages are being redirected to the non-HTML variants.

I have read online people are putting  the 301 redirects manually in their .htaccess

  e.g. RewriteRule ^index.php/?(.*).html$ /$1 [R=301,L]

But is this really necessary when I don't get 404s?

Is manual .htaccess 301 redirect necessary?

Any insight appreciated

Thanks


texts: Add block to layout dynamically in event observer

texts:
I want to know how to use layout.xml with event observer.

I want to show a message in footer when payment made successfully.

I know I have to use the event checkout_onepage_controller_success_action

How to use controller or layout.xml with event observer?


texts: How to get Placed Order Information By Customer Id in magento

texts:
I have tried this to load

$orders = Mage::getModel('sales/order')->load(1100000255);

but this is solution for to load order information of that particular orderId.

But i need to know order summary of particular Customer with his or her Customer id.


texts: How to Add custom data to customer session?

texts: In LoginPost controller using this "Magento\Customer\Model\Session" session. After Login I need to add a custom array to the current customer session. how can i add a custom data to magento customer session? please help me with your valuable answer.


texts: How can add a button for a particular tab in the admin section

texts:
I tried a lot and searched a lot. But couldn't find a way to add a button in a particular tab in the admin section.
when examined the core files,I have found out that the following code is somehow using for adding button in a particular tab. Here is my second tab defining file

<?php
     class Karaokeshop_Banner_Block_Adminhtml_Banner_Edit_Tab_Image extends
     Mage_Adminhtml_Block_Widget_Form
     {
         protected function _prepareForm()
         {
             $form = new Varien_Data_Form();
             $this->setForm($form);
             $fieldset = $form->addFieldset('banner_image',
              array('legend'=>Mage::helper('banner')->__('Banner Image')));

             $this->setChild('add_banner_img',
             $this->getLayout()->createBlock('adminhtml/widget_button')
            ->setData(array(
                'label'  => Mage::helper('banner')->__('Add Banner Image'),
                'id'     => 'add_banner_img',
                'name'   => 'add_banner_img',
                'element_name' => 'add_banner_img',
                'class'  => 'add' ,
                'onclick'=> 'bannerImage.addNewImage()'
            ))
        );
         return parent::_prepareLayout();
    }
    public function getBannerImgButtonHtml()
    {
        return $this->getChildHtml('add_banner_img');
    }
}

But it does not add any button in my tab. How can I add a button in a particular tab? Note that i need to add this button along with the title of the tab .


texts:
Steps to reproduce  :

1) Add a product

2) On Filling State and ZIP code the DHL ajax works and fill up the prices

3) Change the store form USD (Dollar) to EUR (Euro)

Expected result (*)

The Price should change as per the currency of the current store selected by the user.

Actual result (*)

The Price of DHL is the same in all the Currency.


texts: Uncaught SyntaxError: Unexpected token u in JSON at position 0

texts:
Review submission message You submitted your review for moderation. is not showing up immediately after submitting a review. In fact, it will not show up on the product view page at all, and I must navigate to any other page for the message to render.

There seems to be some JS error that prevents fully loading the product view page. Request to get .../pub/static/frontend/Theme/default/en_US/Magento_Ui/template/messages.html isn't on the product view page, apparently due to the JS error displayed in the console. I'm guessing this is likely the issue..

Looks like the object passed to run is undefined.. Where do I go debug this from here? On other pages, one of the objects passed in here is messaged with the review submission message.


texts: How to find cause of Element 'handle': Character content other than whitespace is not allowed because the content type is 'element-only'

texts:
I have reviewed the other posts for this and none of them seem to apply to this situation, so I've been unable to find what's causing this error in the exception.log. The error is thrown during xml validation of the merged xml file. I inserted some code to write the xml to a file so I could inspect it I didn't find anything wrong such as having invalid characters.
We are running Magento 2.4.2 (right now in Developer mode).
How can I find the root cause of this Element 'handle' error?


texts: How to get the product image in Magento 2

texts:
I want to get the product image in Magento 2.

$collection = $this->productCollectionFactory->create()
                ->addStoreFilter($this->_storeManager->getStore()->getId())
                ->addAttributeToSelect(array('name'))
                ->addAttributeToFilter(
                    [
                        ['attribute' => 'name', 'like' => '%' . $searchQuery . '%'],

                    ])
                ->addFieldToFilter('type_id', ['eq' => "sellabletype"]);

            foreach ($collection as $product) {
                $image_url = $this->image->init($product, 'product_page_image_small')->setImageFile($product->getSmallImage())->resize(200, 200)->getUrl();
                $searchCollection[] = ['name' => $product->getName(), 'url' => $product->getProductUrl(), 'image' => $image_url];
            }

But it return only Magento_Catalog/images/product/placeholder/thumbnail.jpg url

How to get product thumbnail image url.


texts: Magento2 How to get the category collection as tree structure under multiselect field programmatically.?

texts: I want show  category collection as tree structure for custom multiselect field at admin end as reference like below


texts: Magento 2 Product Customizable Options to add New Option Type

texts:
I have requirement in Magento 2.2 to add custom option type, but facing errors on frontend and cart page..
Followed below links.
Magento2 : How to add a new product custom option type?
how to add a new customizable product option
Any suggestion to implemented this would be helpful.


texts: Add images to product description content programatically in Magento2

texts:
I want to add images to my product description content block but I don't want these specific images to appear in the product gallery ('image', 'small_image', 'thumbnail').

To add regular images I do it the following way:

$product->addImageToMediaGallery($imagePath, array('image', 'small_image', 'thumbnail'), false, false);
$product->save();

For my description I could do something like that:

$descr = "<img src='".$media_path."' />";
$product->setDescription($desc);

And get the path of images using:

$productimages = $product->getMediaGalleryImages();

Is there any other type of image I could use to achieve my goal ? Or what way should I use to upload these image and reuse them in my product description ?


texts: Relationship between catalog_product_entity and cataloginventory_stock_item

texts:
I am trying to join these 2 tables together to get all the attributes I need from the group of Product Entity tables and join them with the remaining quantity in stock from the Stock Item table. However, the queries I am running right now are not providing accurate information. I am thinking that getting the product_id to join with the catalogiventory_stock_item table is not right.

Does anyone have an idea how these 2 tables can be joined? I know there has to be an intermediate table to get product_id for the entity_id in the catalog_product_entity table.

The query below only returns 40 rows, which I know is not correct.

Thanks.

select cpe.entity_id, cpe.entity_type_id, cpe.attribute_set_id, cpe.type_id,
cpe.sku, cpe.created_at, cpe.updated_at, cpe.has_options,
cpe.required_options
from magento.catalog_product_link cpl
inner join
magento.catalog_product_entity cpe
on cpl.link_id = cpe.entity_id
inner join
magento.cataloginventory_stock_item csi
on cpl.product_id = csi.product_id
where csi.qty > 0;


texts: How to override Magento 2 js using Mixins?

texts:
I want to override the js file in module-checkout/view/frontend/web/js/model/cart/totals-processor/default.js using mixins. Here is my requirejs code:

var config =
{
    config:
    {
        mixins:
        {
            'Magento_Checkout/js/model/cart/totals-processor/default':
            {
                'Anowave_Ec/js/totals-processor/default/plugin': true
            }
        }
    }
};

And here is my override file

define(function () {
    'use strict';

    var mixin = {
        estimateTotals: function (address) {
            var serviceUrl, payload;
            totalsService.isLoading(true);
            serviceUrl = resourceUrlManager.getUrlForTotalsEstimationForNewAddress(quote),
                payload = {
                    addressInformation: {
                        address: _.pick(address, this.requiredFields)
                    }
                };

            if (quote.shippingMethod() && quote.shippingMethod()['method_code']) {
                payload.addressInformation['shipping_method_code'] = quote.shippingMethod()['method_code'];
                payload.addressInformation['shipping_carrier_code'] = quote.shippingMethod()['carrier_code'];
            }

            storage.post(
                serviceUrl, JSON.stringify(payload), false
            ).done(
                function (result) {
                    quote.setTotals(result);
                    /** I added new codes on this part **/
                }
            ).fail(
                function (response) {
                    errorProcessor.process(response);
                }
            ).always(
                function () {
                    totalsService.isLoading(false);
                }
            );
        }
    };

    return function (target) { // target == Result that Magento_Ui/.../columns returns.
        return target.extend(mixin); // new result that all other modules receive
    };
});

I simply followed the documentation on Magento2 site but I'm getting errors like

  target is not a function


texts: Can't login to Magento 2 Admin.... Constantly asking for CAPTCHA

texts:
Having issues attempting to login to the back end of my M2 store. My login is correct, but when I attempt to login, I get an incorrect CAPTCHA message (even though there was no CAPTCHA on the initial login screen) and then I try again and this time it tells me I'm locked out.

I saw a post similar to this here (Can't log into Magento Admin, "Invalid Captcha" error appears) but this seems to just disable CAPTCHA completely and to me, that's more like a band-aid than a real solution. I certainly don't want to disable the CAPTCHA. I just want to resolve this issue and login successfully instead.


texts: Embed only the "Contact us" fields and not the rest of the information

texts:
Our "contact us" page has a chunk of text above the input fields which tells customers about our working hours, contact number etc.

I want to embed the "contact us" fields in another template but without the text above.

Can I just copy the fields and submit button from:
 app\design\frontend\base\default\template\contacts\form.phtml
and put them in my template, or is there a smarter way to do this?


texts:
Trying to create a module that redirects the customer to the account creation page when they add to cart if they are not logged in, I have the following code in app/code/Mason/CheckoutRedirect/Plugin/Checkout/Controller/Cart/Add.php:

namespace Mason\CheckoutRedirect\Plugin\Checkout\Controller\Cart;

class Add
{
    /**
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $objectManager;

    /**
     * @var \Magento\Framework\Controller\Result\RedirectFactory
     */
    protected $resultRedirectFactory;

    /**
     * @var \Magento\Framework\UrlInterface
     */
    protected $url;

    /**
     * Data constructor.
     *
     * @param \Magento\Framework\ObjectManagerInterface $objectManager
     * @param \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory
     * @param \Magento\Framework\UrlInterface $url
     */
    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Framework\Controller\Result\RedirectFactory $resultRedirectFactory,
        \Magento\Framework\UrlInterface $url
    ) {
        $this->objectManager = $objectManager;
        $this->resultRedirectFactory = $resultRedirectFactory;
        $this->url = $url;
    }

    public function aroundExecute(
        \Magento\Checkout\Controller\Cart\Add $subject,
        \Closure $proceed
    ) {
        $contactUrl = $this->url->getUrl('customer/account/create');
        $result = [];
        $result['backUrl'] = $contactUrl;

        $subject->getResponse()->representJson(
            $this->objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result)
        );
        return;
    }
}

All this is doing is returning a JSON object:

{"backUrl":"https://domain.com/customer/account/create/"}

But it isn't redirecting.  I think I might be accidentally over riding the whole class rather than extending it, but I'm not sure what to change to fix it.


texts: Understanding the "module" (or extension)

texts:
I've been able to study 5 Magento shops in the last weeks. And I've noticed a mess in module management.

I've seen 2 places where the modules/extensions appear:

MagentoConnect page: where you can see the module name, description, version and you are able to uninstall or upgrade
/app/etc/modules directory: where the main XML of the module appear

My questions about modules:

1) Why do I see some modules appearing in "etc" directory, but they don't appear in Magento Connect page ?

2) In that cases, how can I uninstall a module?

3) And how can I know which files are related with that module ?

Thank you !


texts: Magento 2: Create product using rest API image upload not working

texts:
I have creating product using rest API but image upload not working.
API: baseurl/rest/V1/products
Method: POST
Body:
{
  "product": {
    "sku": "info",
    "name": "Info",
    "attribute_set_id": 4,
    "price": 1000,
    "status": 1,
    "custom_attributes": [
        {
            "attribute_code": "category_ids",
            "value": ["41","42","43"]
        },
        {
          "attribute_code": "description",
          "value": "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
        },
        {
            "attribute_code": "image",
            "value": "image1.jpg"
        },
        {
            "attribute_code": "thumbnail",
            "value": "image2.jpg"
        },
        {
            "attribute_code": "small_image",
            "value": "image12.jpg"
        }
    ],
    "visibility": 4,
    "type_id": "simple",
    "weight": 1,
        "extension_attributes": {
            "stock_item": {
                "qty": "110",
                "is_in_stock": true
            }
        }
    },
    "saveOptions": true
}

Any help would be appreciated. Thanks!


texts: How to override view.xml file in custom module

texts:
I have change magnifier vars in view.xml file under luma theme. Its working fine .

I have change it in my custom module like this ...

app/code/XXX/YYY/etc/view.xml.

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">

        <var name="magnifier">
            <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
            <var name="top"></var> <!-- Top position of magnifier -->
            <var name="left"></var> <!-- Left position of magnifier -->
            <var name="width">400</var> <!-- Width of magnifier block -->
            <var name="height">400</var> <!-- Height of magnifier block -->
            <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
            <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
            <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
        </var>

Its not working .

And also
In theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>theme name</title>
     <parent>Magento/blank

registration.php:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/OX/yyy',
    __DIR__
);

/app/design/frontend/XXX/yyy/etc/view.xml

<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
        <var name="magnifier">
            <var name="fullscreenzoom">20</var>  <!-- Zoom for fullscreen (integer)-->
            <var name="top"></var> <!-- Top position of magnifier -->
            <var name="left"></var> <!-- Left position of magnifier -->
            <var name="width">400</var> <!-- Width of magnifier block -->
            <var name="height">400</var> <!-- Height of magnifier block -->
            <var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
            <var name="enabled">true</var> <!-- Turn on/off magnifier (true/false) -->
            <var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
        </var>
  </view>

its also not working.

If anything i want to change it.

Thanks.


texts: GraphQL returns null address if optional telephone is set as empty string

texts:
Steps to reproduce

Using GraphQL mutation, add a product to Cart

Set Shipping Addresses on cart using the following Mutation

mutation {
  setShippingAddressesOnCart(
    input: {
      cart_id: "zcatHMtPLY8M8hs0I1ALNihsk8bdRlUI"
      shipping_addresses: [
        {
          address: {
            firstname: "Bob"
            lastname: "Roll"
            company: "Magento"
            street: ["Magento Pkwy", "Main Street"]
            city: "Austin"
            region: "AN"
            region_id: 533
            postcode: "78758"
            country_code: "IN"
            telephone: "" #<---- note that the telephone is an empty string.
            save_in_address_book: false
          },
       }
      ]
    }
  ) {
    cart {
      shipping_addresses {
        firstname
        lastname
        company
        street
        city
        region {
          code
          label
        }
        postcode
        telephone
        country {
          code
          label
        }
        pickup_location_code
      }
    }
  }
}

Response:
{
  "data": {
    "setShippingAddressesOnCart": {
      "cart": {
        "shipping_addresses": []
      }
    }
  }
}

I've tried few things but they didn't work, Does any knows how to resolve it?


texts:
I decided to start learning Magento using the current 2.2.2 version. After studying a bit about it, I managed to install it and apply a themeforest theme.

Despite reading questions here and reading the documentation, I still can't figure out how to move some important blocks around.

Let's take the search bar and user links for example: How do I move these by editing the layout files? Which files am I looking to alter? Should I be doing it in the admin panel?


texts:
I am working in the view.phtml file at the moment. In this file, I am using a custom .phtml file called product.info.phtml. I called it like this:

<?php echo $this->getChildHtml('product_additional_data') ?>

And in the local.xml I called the file like this:

<reference name="product.info.additional">
 <block type="core/template" template="custom/product.info.phtml" name="productInfoTabs" after="-"/>
</reference>

Which works just fine. In this file, I call the upsell.phtml file like this:

<?php echo $this->getChildHtml('upsell_products') ?>

But that doesn't work. If I call it in the view.phtml, it works. But when I call it in the product.info.phtml file, it fails to work.

Here is the code I am using inside the product.info.phtml file:

Test text

  <?php echo $_product->getInfo(); ?>

Test text

  <?php echo $_product->getService(); ?>

Test text

  <?php echo $_product->getInsurance(); ?>

Test text

  <?php echo $_product->getTerms(); ?>

 <?php echo $this->getChildHtml('upsell_products') ?>

EXTRA INFO

I did not make this myself, someone else did. I am just here to solve the bug, so there might be missing some information


texts:
has anyone encountered this problem?

Merge CSS is not working at all altough minifying does.

I'm still in Developers mode, but it's also not working in Production mode. I tried:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

Any of these helped. I also cleared CSS/JS cache from the backend and cleared var/view_preprocessed manually. I also followed other threads here but no success...

Thank you for help!


texts: Getting dropdown attribute value when using addAttributeToSelect

texts:
When loading a collection how can I get the attribute value text (and not just the option number) when its a dropdown attribute.

Example:

$collection = Mage::getResourceModel('catalog/product');
$collection->addAttributeToSelect('color'); // color  is a dropdown attribute

When using this code the option id's are displaying for color such as: 123, 117 etc. and not the text values (like: red, green etc.)

Usually we iterate through each product and get the text for the attribute but since this is being used in the Catalog->Manage products page I'm looking for an alternate solution.


texts:
How do you change price in the frontend without affecting database. I have found the following code for it, but now I want to set my custom price in object.

Magento\Framework\Pricing\Amount\Base Object
(
    [amount:protected] => 36
    [baseAmount:protected] =>
    [totalAdjustmentAmount:protected] =>
    [adjustmentAmounts:protected] => Array
        (
        )

    [adjustments:protected] => Array
        (
        )

)

I want to change amount value programmatically.


texts: Magento - Auto set base, small and thumbnail on upload

texts:
Morning,
We have literally searched all over Stackoverflow and Google to find this solutions but still don't have the right answer.
We're trying to auto-set the Base, Small and Thumbnail options on the first uploaded image, so when uploading multiple images the first image will always have all three options checked.
If anyone has tried and succeeded with find this answer and advice, Thank you.


texts: Magento 2 - What is the proper way to edit core file?

texts:
For my Paypal Payment issue,
I just want to update the following function,
app/code/Magento/Paypal/Model/Api/Nvp.php
protected function _applyStreetAndRegionWorkarounds(DataObject $address)
{
// merge street addresses into 1
if ($address->getData('street2') !== null) {
$address->setStreet(implode("\n", [$address->getData('street'), $address->getData('street2')]));
$address->unsetData('street2');
}
// attempt to fetch region_id from directory
if ($address->getCountryId() && $address->getRegion()) {
$regions = $this->_countryFactory->create()
->loadByCode($address->getCountryId())
->getRegionCollection()
->addRegionCodeOrNameFilter($address->getRegion())
->setPageSize(1);
if ($regions->count()) {
$regionItems = $regions->getItems();
$region = array_shift($regionItems);
$address->setRegionId($region->getId());
$address->setExportedKeys(array_merge($address->getExportedKeys(), ['region_id']));
}
}
}

Instead of
  protected function _applyStreetAndRegionWorkarounds(DataObject $address)
    {
        // merge street addresses into 1
        if ($address->getData('street2') !== null) {
            $address->setStreet(implode("\n", [$address->getData('street'), $address->getData('street2')]));
            $address->unsetData('street2');
        }
        // attempt to fetch region_id from directory
        if ($address->getCountryId() && $address->getRegion()) {
            $regions = $this->_countryFactory->create()->loadByCode(
                $address->getCountryId()
            )->getRegionCollection()->addRegionCodeOrNameFilter(
                $address->getRegion()
            )->setPageSize(
                1
            );
            $regionItems = $regions->getItems();
            $region = array_shift($regionItems);
            $address->setRegionId($region->getId());
            $address->setExportedKeys(array_merge($address->getExportedKeys(), ['region_id']));
        }
    }

Source: https://github.com/magento/magento2/issues/26698
What is the best way to edit core files? Module or Preference or anything else?
My Error:
Fatal error: Uncaught Error: Call to a member function getId() on null in /var/www/html/test/app/code/Magento/Paypal/Model/Api/Nvp.php:1524 Stack trace:
#0 /var/www/html/test/app/code/Magento/Paypal/Model/Api/Nvp.php(1493): Magento\Paypal\Model\Api\Nvp->_applyStreetAndRegionWorkarounds(Object(Magento\Framework\DataObject))
#1 /var/www/html/test/app/code/Magento/Paypal/Model/Api/Nvp.php(849): Magento\Paypal\Model\Api\Nvp->_exportAddresses(Array)
#2 /var/www/html/test/app/code/Magento/Paypal/Model/Express/Checkout.php(621): Magento\Paypal\Model\Api\Nvp->callGetExpressCheckoutDetails()
#3/var/www/html/test/app/code/Magento/Paypal/Controller/Express/AbstractExpress/ReturnAction.php(32): Magento\Paypal\Model\Express\Checkout->returnFromPaypal('*********')
#4/var/www/html/test/generated/code/Magento/Paypal/Controller/Express/ReturnAction/Interceptor.php(24): Magento\Paypal\Controller\Express\AbstractExpress\ReturnAction->execute()
#5 /var/www/html/test/lib/internal/Magento/Framework/App/Action/Ac in /var/www/html/test/app/code/Magento/Paypal/Model/Api/Nvp.php on line 15

Note: Is the following patch suitable for my error,
https://magento.com/tech-resources/download#tab-36   (PayPal Express Checkout issue with region patch for Magento 2.3.4)


texts: Magento 2.1.5 How to remove zero-only decimal points from the displayed prices, preserving the non-zero one?

texts:
I'm trying to remove the .00 part from product pricing. On Category page it can be done with JS, and same on page load for product pages. But, when a user makes attribute selection on a product, the price goes back to showing the .00 because JS is set to on page load.

Any idea how I could go about simply removing the .00 by formatting the price itself?

Side note: I only want to remove the decimal part if price ends in .00, our other customer groups have catalog price rules that give them discounts, and for that we have to keep the decimal values in place.


texts: How to list featured products in the homepage in Magento 1.9 CE

texts:
Im trying to achieve what I though it would be a simple task, of adding a list of manually selected products, to be presented as a featured collection of products.

Tried several options, using custom attributes or data from hidden categories but none of those have worked so far.

Can anyone please recommend a link/solution for this?


texts:
I'm trying to get cross-sell product on view.phtml. It is possible?

I added

<?php echo $this->getChildHtml('crosssell') ?>

into view.phtml and

<block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>

into catalog.xml
but I don't see any result in product page.

Cross sell products are correctly shown only in cart page.

EDIT: If I add a product with cross sell product to che cart, I see them on ALL product pages.


texts: How to calculate a price of a product with custom size?

texts:
I’m new to Magento and trying to develop an extension that will do the following.
I have a product with standard dimensions (like 600 x 2000 mm, 700 x 2000 mm) but the product can be also made in any custom size (like 654 x 2102 mm etc).
There must be an option to switch from drop-down window with a list of standard sizes to a text field, so a client can insert its desired dimensions.
And the most complicated part is calculating the price. The price is calculated according to the following logic: find nearest bigger standard size (by area) and add 10%.
What would be the best approach to doing this? Thanks in advance!


texts: How to include a block one time with page layout xml

texts:
My block is being included twice inside my cms page from my page layout. Here is my code:

# File: theme_dir/Magento_Theme/page_layout/homepage.xml
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::homepage.phtml" />
    </referenceContainer>
</layout>

# File: theme_dir/Magento_Theme/layouts.xml
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="homepage">
        homepage
    </layout>
</page_layouts>

# File: theme_dir/Magento_Theme/templates/hompeage.phtml

Homepage Content

Of course, I have also set my home cms page to my homepage template.

When the page loads I see the phtml file included twice. Inspecting the page I see the following:

    ...

Homepage Content

Homepage Content

I've tried changing name="page.wrapper" to other references, such as main, columns, etc., (note this required using update handle 1column instead) but the outcome is the same, the content get's included twice.

The closest success I have had is that this does not seem to happen when I use the page layout in a category page.

Is this expected behavior? How to include the block a single time?

Magento 2.1.3 CE


texts: Hook into "order shipped" event and get order id for order shipped

texts:
I have created a module that hooks into the

sales_order_shipment_save_after

event. I have tested the hook is working with Mage::log, My question is, how do I get the order id for the shipment that was just created?
Edit: I tried the following, but $orderId is returning blank in the log...

public function invoice_and_complete($observer)
{
   $event = $observer->getEvent();
   $orderId = $event->getOrderIds();

   Mage::log($orderId);
}


texts: how to get status of last order id in magento2 sql query?

texts:
i want to get last order id along with order status in magneto2, i use this query to extract it but the status is not extracting correct:

SELECT max(entity_id) , STATUS FROM sales_order

  max entity id returns last order but the status of the last order is
  returning wrong it's returning status of first order , please help me
  to correct my sql query.

i am using this code in magento2 api:

$con = mysqli_connect("localhost","root","","development_v2");
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
else{

        $sql2 = "SELECT max(entity_id) and status FROM sales_order";
        $result_set2 = mysqli_query($con,$sql2);
        if ($result_set2) {
            $rowB = mysqli_fetch_array($result_set2);
            $hamza = $rowB['max(entity_id)'];
           // echo $hamza;
        } else {
            echo 'No latest order';
        }
        mysqli_close($con);
}


texts: custom address attribute with module: saving in admin and not in frontend

texts:
i developed a module to add two new fields in costumer address. The fields are showing but not saving in frontend checkout procedure. The fields are showing also in the admin area and there they saves correctly.
Now, i don't know how to  debug this.
How can i check where the problem is in the frontend?
Thank you.

EDIT

Ok, now i understand that my two custom attributes (codice_sdi and indirizzo_pec) are not saved in the shippingAddress javascript object. I've seen this using console.log.
Any ideas?


texts: How to override ProductRepository model file in Magento2?

texts:
I need to override processMediaGallery method from

  \vendor\magento\module-catalog\Model\ProductRepository.php

I used below code in my custom module etc/di.xml.

< preference for="\Magento\Catalog\Model\ProductRepository" type="YourNamespace\YourModule\Model\ProductRepository" />

And added the ProductRepository.php file into my custom module Model folder of module-catalog from the vendor.

I am getting below error after doing this.

ProductFactory does not exist in [Bms\Shop\Model\ProductRepository\Interceptor]

Have anyone faced the same issue?


texts: how to prevent xss attacks and sql injection in magento 2

texts: I need to know if there are some configuration from Bo or some patch to prevent those type of attack.


texts:
I have two fields that I want to save as a comment in the request: the first one would be a reference point and the second would be the client's address type (residential or commercial), but the code I found can save only one comment per request and I you would need to save two fields as a comment in the request.

I would like to know how can I save two fields as comment in the request and not just one?

I will leave the code I have of which only saves one comment in the request, which is contained in the Observer.php file.

 if (!empty($oscOrderData['comments'])) {

        $order = $observer->getEvent()->getOrder();
        /* @var $order Mage_Sales_Model_Order */

        $order->addStatusHistoryComment('Consultor do atendimento: ' . $oscOrderData['comments']);
        $order->save();
    }

Note: comments is the id of the field to be saved.

First field to comment:

<?php echo $this->__('Referência: ') ?>

   <input class="input-text required-entry" id="comments" name="comments" title="<?php echo $this->__('Reference point') ?>" />

Second field for comment:

<select class="required-entry" id="comments" name="comments" title="<?php echo $this->__('Type of address') ?>" class="validate-select onestep required-entry">
   <option>Select</option>
       <option value="Residential">Residential</option>
       <option value="Commercial">Commercial</option>
</select>


texts: How to set Billingaddress during sales_order_place_before programmatically

texts:
I need all orders to have the same billing address (its because the store is used company internal) but the shipping address may vary. My thought was to set the Billing Address programmatically during sales_order_place_before.

Somehow the code throws me a 500 Error every time I want to submit my checkout.

I have created an Observer, it triggers on sales_order_place_before, but somehow I cant get it running. I can't really find anything on this topic, I found this Update Shipping Address Similar to Billing Address before/after placing an order using Observer? but it doesn't work for me.

public function orderPlaceBefore($observer) {

    $order = $observer->getEvent()->getOrder();
    $billing_address = $order->getBillingAddress();
    $shippingAddress = Mage::getModel('sales/order_address')
        ->setCustomerId($billing_address->getCustomerId())
        ->setCustomerAddressId($billing_address->getCustomerAddressId())
        ->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_SHIPPING)
        ->setFirstname($billing_address->getFirstname())
        ->setMiddlename($billing_address->getMiddlename())
        ->setLastname($billing_address->getLastname())
        ->setSuffix($billing_address->getSuffix())
        ->setCompany($billing_address->getCompany())
        ->setStreet($billing_address->getStreet())
        ->setCity($billing_address->getCity())
        ->setCountry_id($billing_address->getCountryId())
        ->setRegion($billing_address->getRegion())
        ->setRegion_id($billing_address->getRegionId())
        ->setPostcode($billing_address->getPostcode())
        ->setTelephone($billing_address->getTelephone())
        ->setFax($billing_address->getFax());

    $order->setShippingAddress($shippingAddress);


texts: Magento 2 : Get last five order information using DI on homepage?

texts:
I want to get last 5 order information on home page.

  Question : How to get last five order collection information on homepage?

NOTE : Avoid giving answers using object manager.

Any help would be appreciated.


texts:
On our Magento website we have set free shipping for all orders over €50 but have noticed that sometimes it does not work.  I've been testing it and it seems to work when I tried it on orders over €62 & €69.  But it did not work for orders of €50 €53.50, €55, €58.50, €59.95, €60.

Euro is our base currency.  I've tried re-indexing and clearing the cache.

These are our settings...

I tried changing the order sub-total value to €49.99 from €50 but that did not help at all.

ABW *   *   0   30
ABW *   *   49.99   0
AFG *   *   0   30
AFG *   *   49.99   0
AGO *   *   0   30
AGO *   *   49.99   0
AIA *   *   0   30
AIA *   *   49.99   0
ALA *   *   0   30
ALA *   *   49.99   0
ALB *   *   0   30
ALB *   *   49.99   0
AND *   *   0   30
AND *   *   49.99   0
ANT *   *   0   30
ANT *   *   49.99   0
ARE *   *   0   30
ARE *   *   49.99   0
ARG *   *   0   30
ARG *   *   49.99   0
ARM *   *   0   30
ARM *   *   49.99   0
ASM *   *   0   30
ASM *   *   49.99   0
ATA *   *   0   30
ATA *   *   49.99   0
ATF *   *   0   30
ATF *   *   49.99   0
ATG *   *   0   30
ATG *   *   49.99   0
AUS *   *   0   20
AUS *   *   49.99   0
AUT *   *   0   12.5
AUT *   *   49.99   0

I also tried it again with a new table rates file for just one country.

Country Region/State    Zip/Postal Code Order Subtotal (and above)  Shipping Price
IRL *   *   0   6
IRL *   *   50  0


texts: Where is decided wether frontend or backend locale is used for translation?

texts:
For the shipment email, I get the payment info from a third party extension. But the info field names are in English, while the rest of the email is in German. After some bug searching I found that the extension always returns the payment info in the backend locale, which is set to English.

What I want to know is: How does Magento decide which language it uses for translation, when frontend and backend use different languages? Is there a way to keep the backend in English while still using this extension to get the payment info for the shipment email? The same payment info is shown in the backend when viewing order information, so I'd need both translations to work.

This how one of the fields is set in the code:

$data[(string)__('Payment reference:')] = $sTransId;

At that point, $this->area is set to 'frontend', but it seems that this information isn't used.


texts: Why the input element id's for one-page-checkout are in "type:elementname" format?

texts:
Why magento One-Page-Checkout page has the input fields with Id's that cannot be referred to any CSS attributes or by a javascript / jquery? Does this holds any security measures ? or it can be customized to CSS / Js friendly ID's ?

How can I set the inputs First-Name and Last-Name capitalized or add a blue border to these fields alone.


texts: Is it possible to pull all attributes from within a attribute sets folder?

texts:
This is something I have been wondering, I wish to allow clients to add and take away the products tabs they want quite easily and this is one way I can think of doing it.

Currently my idea is to just programmatically use a loop to pull attributes called customtab1, customtab2, etc but I wanted to make it a bit easier on the client, and inevitably avoid the issue of client misspelling.

I do like the loop idea purely so I can kill the loop at a certain number to keep my designer coworkers happy by ensuring the client doesn't add a million tabs. So if there is no way to do it then there is no loss.

Edit: Sorry if I wasn't clear. In attribute sets you can set up a folder with attributes in them, is there a way possible on the front end product page to call all attributes by the folder they are placed in? So instead of calling one attribute, you would call the attributes folder and then with a foreach echo out each separate ones textvalue?


texts: Payment Method not showing information in admin order detail

texts:
I've created a custom payment method and want to see the information inside the admin order detail page.

The payment method is a custom instore payment method and working so far.

I'd like to know how to get the name of the used payment method or its additional information into the order detail page

I already tried to follow the instructions from the  official magento 2.3 docs . The examples are not working and containing deprecated functions.

The examples in the docs for the braintree module are not working for my use-case and some functions used for the offline-payments are deprecated: e.g bank transfer payment model using $this->getConfigData(..) from Magento\Payment\Model\Method\AbstractMethod indicates a deprection @deprecated 100.0.6 for the file. The function getConfigData() is deprecated in @deprecated 100.2.0

Unfortunately it doesn't give any clue how to replace the deprecated function and only points to the devdocs in version 2.1.

Since this payment method is offline I also tried to make my codes similar to the offline payment methods on github.


texts:
upgrade to Magento2.3.1 with porto theme version 3.7.1  showing white screen
on Product page and Category pages.
Other page working fine

PHP Version 7.1.27

There no error of php and js in console.

  No content in Body tag


texts: Custom block not rendering in custom structural block

texts:
I've created a two custom structural blocks. Both blocks are sidebars that are used for navigation, cart, authentication etc. Each structural block has its own core/template block which acts as a wrapper for the content.

<reference name="root">
     <block type="core/text_list" name="sidebar.left" as="sidebar-left" translate="label">
        Mobile_Nav
     </block>
     <block type="core/text_list" name="sidebar.right" as="sidebar-right" translate="label">
        Sidebar
     </block>
</reference>

Both blocks work fine, and I've added multiple customs and non default blocks to them. However, I fail at loading a custom block responsible for login/authentication. I can however load this block in the content block.

<reference name="sidebar.right">
    <block type="core/template" name="sidebar.right.content" template="page/html/sidebar-right.phtml">
         <block type="checkout/cart_sidebar" name="cart_sidebar" as="sidebar.cart" template="checkout/cart/sidebar.phtml"/>
         <block type="ajaxauthentication/sidebar" name="authentication_sidebar" as="authentication" template="ajaxauthentication/welcome.phtml" />
         <action method="setChild"><child>"authentication_sidebar"</child><alias>authentication</alias></action>
    </block>
</reference>

I suspect it has something to do with that the structural block does not yet exist when I call the ajaxauthentication block. However, I am neither sure nor clueless how to solve it.


texts: Migration to Magento from Cubecart without loosing Google Rankings

texts:
I want to migrate my e-store to Magento from Cubecart.

The domain will remain the same. www.example.com

But i want to keep my Google Rankings at least for the most popular URLS.

I try to fix this using Magento URL Rewrite tool. But when i try i face two problems.

1) I inserted a new URL Rewrite rule but i think that when i reindexed URL Rewrites from Index Management everything lost. (not sure).

2) When i insert "something" to request path it works ok. But when i insert "?something" (query string) it does not redirect!

Am i have to enable query strings for magento somehow?
If i enable query strings then i will loose all my SEO friendly URLS?

Thanks in advance


texts: Magento2.3: Welcome message is not displaying correctly

texts:
The welcome message is not displaying once the customer logged in to the website and its only displaying after 20 sec, sometimes it's taking even 5 min to display.

Is that because of performance issue or I have missed anything?

What could be the issue?


texts: M2 - After move catalog.topnav to header.panel how to include catalog.topnav inside hamburger menu in mobile view

texts:
After creating a custom theme that is inherited from a blank theme i am getting an error in mobile menu,
My mobile menu look like,

How to move all my categories into the left hide bar(toggle menu) i mean

any help thanks.
Note (web-view) - Moving element using <move element="catalog.topnav" destination="header.panel" after="logo" />
How to move catalog.topnav into hamburger menu in the mobile view?


texts: Why do i see configurations at simple product and how can i remove it in Magento 2?

texts:
There's a section where i can add Configurations even when i choose to Add Simple Product and i'd like to remove it.

There's another section with a title Downloadble that i was able to disable by change the code in its Composite.php file.

from:

        DownloadableType::TYPE_DOWNLOADABLE,
        CatalogType::TYPE_SIMPLE,
        CatalogType::TYPE_VIRTUAL

to:

        DownloadableType::TYPE_DOWNLOADABLE,
        CatalogType::TYPE_VIRTUAL

i was looking for a similar solution but the code is different.


texts: Can I change the Continue Shopping button by store?  I want one store to link to an ETERNAL site whereas all others can link back to site home page.


texts: How to implement master/slave database configuration in Magento 2 community edition?

texts:
As we know master/slave or split database configuration is possible with Magento 2 enterprise edition and not with the community edition.

How we can implement master/slave or split database functionality in community edition? Is there way/resource/tutorial which can help me to achieve this functionality?


texts:
For example I have set of urls, their rewrites, etc:

test1.html
catalog/product.html
thank-you
catalog/product/view/id/34

All this URLs gives 200 OK at response. My aim is to filter incoming URLs and don't allow URLs that do not exists inside Magento (404 response I think).

How can I define that this URL will give 200 OK inside of Magento?


texts: magento 2 api /V1/products/attributes/{attributeCode}/options add attribute options

texts:
I am trying this code to add an option to an attribute:

$sampleOptionData = array(
    "label"     => "2200",
    "value"     => "2200",
    "sortOrder" => 100,
    "isDefault" => false,
    "storeLabels" => array (
        array( "storeId" => 1, "label" => "2200" )
    ),
);

$arrayData = json_encode(array('option' => $sampleOptionData));

$ruta = 'http://127.0.0.1:8888/index.php/rest/V1/products/attributes/metros/options';

$ch = curl_init( $ruta );

$curlOptions = array(
    CURLOPT_CUSTOMREQUEST  => "POST",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => $arrayData,
    CURLOPT_HTTPHEADER => array( "Content-Type: application/json", "Authorization: Bearer " . $token)
);

curl_setopt_array( $ch, $curlOptions );

$response = curl_exec( $ch );

// Comprobar el código de estado HTTP
if (!curl_errno($ch)) {
  switch ($http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE)) {
    case 200:  # OK
        print_r($response);
        break;
    default:
      echo 'Código HTTP inesperado: ', $http_code, "\n";
      print_r($response);
  }
}

// Cerrar el manejador
curl_close($ch);

but when run i get this error:

  HTTP code: 400
  {"message":"Cannot save attribute %1","parameters":["metros"]}

metros is an attribute product a its {attribute_code} is "metros".

Important if I run similar code in python works fine.


texts: Magento2: How to get Last level category?

texts:
I need last level category of each sub category.
I mean a category which has no child category.


texts:
I need to display the total price of products by tax in orders and invoices on magento 1.9.
So:

Product001 // 100€ exc. tax // tax 6% // Total tax: 6€ // Total 106€
Product002 // 100€ exc. tax // tax 21% // Total tax: 21€ // Total 121€
Product003 // 200€ exc. tax // tax 6% // Total tax: 12€ // Total 212€
Product004 // 200€ exc. tax // tax 21% // // Total tax: 42€ // Total 242€

What i need is to get the total by tax:
Tax 6% = 300€ (Product001 + Product003) // Total tax: 18€ // total: 318€
Tax 21% = 300€ (Product002 + Product004)...

How to get the sum of all product prices, exclude tax, of certain tax?

Thank you.


texts: What is the meaning of the is_autogenerated field for category url_rewrites?


texts:
I would like to know if there is a way, maybe some module, that allows me to have Magento 2 installation with several stores where each store has an independent Admin Login.

Thanks!


texts: Show customer data after setCustomerAsLoggedIn()

texts:
Im experiencing an issue with Magento 2.1.7

I want to login users programmatically by only their email.

But after setCustomerAsLoggedIn it still shows sign in or create an account in the header.

This issue is the same as Show customer name after setCustomerAsLoggedIn()

which still hasn't been resolved.

/* Magento\Customer\Model\Customer $this->customer */
$Customer = $this->customer->loadByEmail('foo@example.com');
/* Magento\Customer\Model\Session $this->customerSession */
$this->customerSession->setCustomerAsLoggedIn($customer);


texts: Magento 2 layout file marketplace_seller_account_create.xml isn't loading

texts:
I've a controller file   Amitshree\Marketplace\Controller\Seller\Account\Create.php with following code:

<?php
    namespace Amitshree\Marketplace\Controller\Seller\Account;
    use Magento\Framework\App\Action\Context;
    use Magento\Framework\View\Result\PageFactory;

    class Create extends \Magento\Framework\App\Action\Action
    {
        /**
         * @var $resultPageFactory
         */
        protected $resultPageFactory;
        /**
         * Create seller account constructor.
         * @param Context $context
         * @param PageFactory $resultPageFactory
         */
        public function __construct(
            Context $context,
            PageFactory $resultPageFactory
        )
        {
            parent::__construct($context);
            $this->resultPageFactory = $resultPageFactory;
        }

        /**
         * @return \Magento\Framework\View\Result\Page
         */
        public function execute()
        {
            //exit('hi'); // works fine
            $this->resultPageFactory->create();
        }
    }

and layout file marketplace_seller_account_create.xml with following code

<?xml version="1.0" encoding="UTF-8" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <title>Request your account as a Seller.</title>
</head>
    <body>
        <referenceContainer name="content">
            <container name="seller.account.create" label="Create Seller Account" htmlTag="div" htmlClass="seller-account-create">
                <block class="Magento\Framework\View\Element\Template" name="seller_account_create" template="seller/account/create.phtml"></block>
            </container>
        </referenceContainer>
    </body>
</page>

routes.xml

<?xml version="1.0" encoding="UTF-8" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="marketplace" frontName="marketplace">
            <module name="Amitshree_Marketplace"></module>
        </route>
    </router>
</config>

When I visit the url website.com/marketplace/seller/account_create/ , it shows a blank page without any errors. Naming convention of my layout file is wrong?


texts: Price showing as 0 on product grid but correct price when you click into it

texts:
I have imported some products into Magento and I am faced with this problem.

I don't really know where to start debugging this. This is how I am setting the price at the moment (removed some data for clarity):

$productData = array(
        'price'                             => $sellPrice
    );
$mc = new Mage_Catalog_Model_Product_Api();
$mc->update($productId, $productData);

Should I be updating another attribute somewhere?

Edit When debugging the SQL that runs, I can see in Grid.php _prepareCollection that $collection->addAttributeToSelect('price'); is called but when I do (string)$this->getCollection()->getSelect() the price column isn't selected in the SQL which I assume is why they all default to zero.


texts:
We want to be able to export specific product data in MS XML Format using Dataflow.
I realized it does not export group prices, whereas the CSV standard export does this. I couldn't see any option to either

get group prices to be part of XML or
change standard export to other format than CSV

It doesn't even make sense to have a drop-down to select the format, if only CSV is there.

Does anyone have a solution for this?


texts: product name not displaying in custom admin grid in magento2

texts:
hello everyone I want to display the product name in custom admin grid code is below
info.php

$fieldset->addField(
        'entity_id',
        'text',
        [
            'name'        => 'product name',
            'label'    => __('product name'),
            'renderer'  => 'Magneto\BookFreeLayout\Block\Adminhtml\Extension\Grid\Renderer\Productname',
            'required'     => true,

        ]
    );

productname.php

<?php
namespace
Magneto\BookFreeLayout\Block\Adminhtml\Extension\Grid\Renderer;
use \Magento\Catalog\Api\ProductRepositoryInterface;
use \Magento\Framework\View\Element\UiComponent\ContextInterface;
use \Magento\Framework\View\Element\UiComponentFactory;
use \Magento\Ui\Component\Listing\Columns\Column;
class Productname extends Column
{
protected $_ProductRepository;
public function __construct(
ContextInterface $context,
UiComponentFactory $uiComponentFactory,
ProductRepositoryInterface $ProductRepository,
array $components = [],
array $data = [])
{
$this->_ProductRepository = $ProductRepository;
parent::__construct($context, $uiComponentFactory, $components,
$data);
}
public function prepareDataSource(array $dataSource)
{
 if (isset($dataSource['data']['items'])) {
    foreach ($dataSource['data']['items'] as $key => $items) {
        $product = $this->_ProductRepository-
 >getById($items["entity_id"]);
        $dataSource['data']['items'][$key]['entity_id'] = $product-
  >getName(); //to get product name
    }
   }
   return $dataSource;
  }
  }

I have written this code but entity id is displaying entity id is the foreign key


texts: Customer address does not automatically update in order details

texts:
This is the problem:

A customer creates an order.
After that he changes his address on the customer account page.
The address on the order he already created does not automatically update.
So we send the order to the wrong address.

Anyone a solution for this?

Is there for example a possibility to get a notification by email when a customer changes his address?


texts: move the product detail section to footer container

texts:
i've the following code in themename/template/catalog/product/view.phtml

<div class="product-collateral">
    <?php echo $this->getChildHtml('info_tabs') ?>
    <?php echo $this->getChildHtml('additional_info'); ?>
    <?php echo $this->getChildHtml('product_additional_data') ?>
</div>
    <?php echo $this->getChildHtml('related_products') ?>
    <?php echo $this->getChildHtml('upsell_products') ?>

i move above code in themename/template/page/html/footer.phtml, but it displays nothing, anyone know what are the problems?


texts:
Information: I'm using Magento 2.1 on CentOS Linux, my theme is a child of the built-in Luma theme.

When the theme I made is active, I want some blocks to be removed. Let's say I want to remove the SKU number from the product page.

What I do is:

In my theme folder, I add a file called Magento_Catalog/layout/catalog_product_view.xml, with the following content

<?xml version="1.0"?>
<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.sku" remove="true" />
    </body>
</page>

I change the version in composer.json from 100.x.0 to 100.(x+1).0 (so for example if the current version is 100.2.0 I change it to 100.3.0). To be honest, don't really know if this is necessary.
I delete the <theme-name> folders from pub/static/frontend/<theme-vendor> and var/view_preprocessed/css/frontend/<theme-vendor>.
I run the following commands from the Magento root:

sudo php bin/magento cache:clean
sudo chown -R <user-of-Magento>:<group-of-that-user> *
sudo php bin/magento setup:static-content:deploy nl_NL en_US
sudo chown -R <user-of-Magento>:<group-of-that-user> *

But the block is still there! Unchanged. I tried other blocks, like the add to cart button, but also without success.

What should I do? Thanks in advance.


texts: Disable add to wish list and add to compare

texts:
I need to write a plugin for denying visitor to add to wish list and add to compare. But i cannot find which model and function i should refer to. I have implemented it successfully to disabling add to cart.

Following is my implementation sample for intercepting add product to cart.

Note: I do not wish to remove the block from user interface.

What type name and function should i refer to for:
1) Add to wish list
2) Add to compare
3) Send Email

For add to cart

<type name="Magento\Checkout\Model\Cart">
        <plugin name="interceptAddingProductToCart"
                type="Vendor\Module\Plugin\Cart"
                sortOrder="10"
                disabled="false"/>
</type>

Plugin Function

public function beforeAddProduct($subject, $productInfo, $requestInfo = null)
    {
        // logic here
    }


texts: Magento - Error 500 - Internal Server Error

texts:
I just finished with this whole website and all is working fine, I want to install french pack via ssh, I had problem with memory so I used root access to install and the installation was successful,

when I turned back to the website I couldn't access and I get this

  Error 500 - Internal Server Error An error was encountered while processing your request. Typically this is a temporary condition. Please contact the web site owner for further assistance.

when I delete .htaccess I can access the front page only with no css, If I click on a link I got 404 Error

the module doesn't appear when I check modules status using

php bin/magento module:status

so I can't disable or delete it, even if I rename the vendor/imaginaerum folder nothing change

I also ran

find . -type d -exec chmod 500 {} \;
find . -type f -exec chmod 664 {} \;
chmod 777 -R downloader var media

to fix if any file permission but no result also

the French package I've installed
http://imaginaerum.github.io/magento2-language-fr-fr/


texts:
I'm having a problem with VAT value. I've searched for a solution in this forum and on other sites, but none seems to be solving mine. To be precise:
I'm using Magento to list my offers on eBay.

When customers make their order, my WMS system catches this order from Magento and creates order only with proper value when client orders 1 piece of 1 SKU + shipping (also works when order shows 2 or more pieces of same SKU) in the WMS system. When someone orders 2 SKU's or more, my whole VAT is being doubled by WMS, even if Magento shows proper value.
I tried to change setting in magento (also checked config.xml file), but after that double VAT was applied to even order with 1 SKU. I have restored settings to previous and now I'm waiting for new 2 or more SKU's order, but I'm afraid that the problem still will be the same.

I have spoken with IT service in my company but they blame settings in Magento, which seems to be fine. Does any1 have some clue what's going on?


texts: Conditionally Disable Checkboxes in Custom Sales Order Grid

texts:
I have a custom admin UI Component that's a variation of the standard Sales Order Grid.
I'd like to disable the mass action checkbox depending on the status of the order.
How can I do that, either through backend classes or through JS in the frontend (whatever the correct Magento way is)?


texts: How to change the font for a specific store view in magento 2.2.6

texts: I have two store-views which are English and Arabic and would like to change the font of the Arabic store-view for all front-end contents. please any help


texts: How to add a JS script after full page loading in checkout in magento2?

texts:
Since the checkout page is loaded asynchronously, I am not able to call the js script after entire page is loaded.I tried using below code

require(['jquery'],function($){
        $(document).ajaxComplete(function(){
            if($('#checkout-loader').length == 0)
            {
                alert("Completed Loading");
            }
        })

    })

But the above code is called twice after loader is remove.Please suggest me how can i implement after all the elements are loaded


texts: Add attribute to "related product" filter grid

texts:
I would like to add an extra attribute let say "Brand" into related product grid to filter products. I have found and implemented this code below but it shows that attribute only in Manage product grid, not in single product related product grid.

My system.xml file has this code

 <filter_attribute>
   <label>Attribute to filter by</label>
   <frontend_type>select</frontend_type>
   <source_model>inchoo_product_filter/attributes</source_model>
   <sort_order>2</sort_order>
   <show_in_default>1</show_in_default>
   <show_in_website>0</show_in_website>
   <show_in_store>0</show_in_store>
 </filter_attribute>

and model

<?php

class Inchoo_Productfilter_Model_Attributes
{
    public function toOptionArray()
    {
        $ignoreAttributes = array('sku', 'name', 'attribute_set_id', 'type_id', 'qty', 'price', 'status', 'visibility');

        $collection = Mage::getResourceModel('catalog/product_attribute_collection')
            ->addVisibleFilter();

        $result = array();
        foreach ($collection as $model) {
            if(in_array($model->getAttributeCode(), $ignoreAttributes)) {
                continue;
            }
            $productCollection = Mage::getModel('catalog/product')->getCollection();
            $productCollection->addAttributeToSelect(array($model->getAttributeCode()));
            $productCollection->addAttributeToFilter($model->getAttributeCode(), array('gt' => 0));

            if(count($productCollection->getData()) > 0) {
                $result[] = array('value' => $model->getAttributeCode(), 'label'=>$model->getFrontendLabel());
            }

        }

       return $result;

    }
}

This attribute is showing in manage product.

But not in the related product.

Please help.

I resloved this

If anybody else facing this issue here the solution how I solved blow.

Go to this file -> Mage\Adminhtml\Block\Catalog\Product\Edit\Tab\Related.php

And paste this code below

$attribute  = Mage::getResourceModel('catalog/product')->getAttribute('brand');
        $preOptions = $attribute->getSource()->getAllOptions(false);

        $options = array();
        foreach($preOptions as $option) {
            if($option['value']) {
                $options[$option['value']] = $option['label'];
            }
        }

        $this->addColumn('brand', array(
             'header'  => $this->__($attribute->getFrontendLabel()),
             'width'   => '100px',
             'type'    => 'options',
             'index'   => $attribute->getAttributeCode(),
             'options' => $options,
        ));

You can also get your custom attribute just change the "brand" identifier to your own created in custom attribute.


texts: how to create select field in cart rule form admin magento 2

texts: can you please suggest me how to create custom field set in shopping cart rule for magento 2 admin. Actually i want to set shopping cart rule for perticular customer with perticular product. can you please suggest how can i do it ?


texts: Override pager.phtml depending of page where it is used

texts:
because of the fact, that Magento2 is using the word "item" in all pager views, I have the problem because of the translation. In category view, I want to translate it as "Artikel", but in the user account list of orders, I do want to have the translation "Bestellungen" and not "Artikel".

Therefore, I thought to override the pager.phtnl template file depending on which site it is used. But no way I found on the internet worked.

Unfortunately, as with many other blocks the definition of a template file like:

<block class="Magento\Theme\Block\Html\Pager" name="sales_order_item_pager" template="Magento_Theme::html/pagertest.phtml"/>

in sales_order.view.xml is not working. It is still using pager.phtml defined int Magento_Theme/templates/html

Does anybody have an idea how to get this working?

As I said doing it with my own module did not work. I tried a couple of suggestions.

Hopefully, somebody does have an answer.

By the way, I am working with Magento 2.3.3

Regards,
Chequille


texts: sales_order_save_commit_after event triggered twice?

texts:
I registered an observer for the sales_order_save_commit_after event to be notified when a new order comes in. This works fine but the event is triggered two times in a row with the same order.

My config.xml

        <sales_order_save_commit_after>
            <observers>
                <unique_sales_order_save_commit_after>
                    <type>singleton</type>
                    <class>mymodule/observer</class>
                    <method>export</method>
                </unique_sales_order_save_commit_after>
            </observers>
        </sales_order_save_commit_after>

How can I check if it's the first time or which other event would be better?

Update

I also tried the sales_order_invoice_pay event (found on SO) but that is not triggered for me.


texts: Issues with re-indexing process on magento store

texts:
I have just re-index the data using custom script and its generate this error :

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'abs', ( - i.price), IF( = 'fixed', , ROUND(i.price * ( / 100), 4)))), 0) AS `' at line 1

I have tried by making the catalog_product_flat_1 table but still the same issue


texts: Manage SM Dynamic Slideshow slider effects

texts:
hi am using SM Dynamic Slideshow and i need to change the effects of slider. Now some random effect is coming on each slide. i need one effect for all slides. please help.

thank you.


texts: How can i run a javascript just one time in phtml in Magento 2

texts:
I have a GTM script for login in Magento_Customer/templates/account/dashboard/info.phtml

<script>
dataLayer.push({
    'events':{
        'event':'login',
        'category':'login',
        'action':'login',
        'label': <?php echo "'" . $block->getCustomer()->getId() . "'" ?>

    },
    'user':{
        'visitorLoginState':'logged in'
    }

 });
</script>

I want this script to run just one time, when a user is logged in.
Now if a refresh the browser the script run again.

Does anyone know how can i run this script just one time?

A know i can use registry, but i am in a phtml.

Thank you!


texts: Explanation regarding phtml coding in magento 2

texts:
When I explored the header links and footer links inside the files of Magento 2, the links are declared like each in one seperate default.xml file inside individual modules. But the links are displayed in same block at frontend as list elements.
The phtml coding is different from Magento 1.9.x. My doubt is how they are grouping the seperately declared blocks (in default.xml) and displaying in frontend as a single block elements (list) using phtml files.

Can someone please explain the concept in easily understandable way. Am a beginner in php coding and newbie to Magento 2.

Explanation with a sample phtml file example:footer.phtml is most welcomed.


texts: Why is there an extra folder in my file path?

texts:
I am getting 404 errors for my javascript. I have ran static content deploy and all of the other commands that are recommended to clear this error but it doesn't matter. An example of my issue is this file-

/static/version1562689420/frontend/theme/themechildchild/en_US/Magento_Search/form-mini.min.js

shows as a 404 on the frontend.

When I look in my actual files that file does not exist but this one does-

/static/version1562689420/frontend/theme/themechildchild/en_US/Magento_Search/js/form-mini.min.js

What would cause that extra /js/ in the file path?

The only require js file I have is this one-

var config = {
paths: {
    slick: 'js/slick.min',
    slaask: 'js/customscript'
},
shim: {
    slick: {
        deps: ['jquery']
    },
    menu: {
        deps: ['jquery']
    }
}
};


texts:
I have created a custom news module in Magento 2.

News module includes admin listing and edit.

But it is showing fatal error.

  Fatal error: Class Namespace\Module\Controller\Adminhtml\Enquiry
  contains 1 abstract method and must therefore be declared abstract or
  implement the remaining methods
  (Magento\Framework\App\ActionInterface::execute)

My controller code is given below

<?php

namespace Namespace\Module\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Registry;
use Magento\Framework\View\Result\PageFactory;
use Namespace\Module\Model\EnquiryFactory;

class Enquiry extends Action
{
    /**
     * Core registry
     *
     * @var \Magento\Framework\Registry
     */
    protected $_coreRegistry;

    /**
     * Result page factory
     *
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $_resultPageFactory;

    /**
     * Enquiry model factory
     *
     * @var \Mbf\Enquries\Model\EnquiryFactory
     */
    protected $_enquiryFactory;

    /**
     * @param Context $context
     * @param Registry $coreRegistry
     * @param PageFactory $resultPageFactory
     * @param EnquiryFactory $enquiryFactory
     */
    public function __construct(
        Context $context,
        Registry $coreRegistry,
        PageFactory $resultPageFactory,
        EnquiryFactory $enquiryFactory
    ) {
       parent::__construct($context);
        $this->_coreRegistry = $coreRegistry;
        $this->_resultPageFactory = $resultPageFactory;
        $this->_enquiryFactory = $enquiryFactory;
    }

    /**
     * Enquiry access rights checking
     *
     * @return bool
     */
    protected function _isAllowed()
    {
        return $this->_authorization->isAllowed('Namespace_Module::manage_enquiry');
    }
}


texts: Website freezes in checkout on a multistore Magento 2 installation

texts:
My default store works perfectly fine. I recently created a second store (each store is accesible through its own domain name) on the same magento installation and I noticed one error/bug in the checkout process.

After entering customer data in the first step of checkout, I click on "Continue" and the loading icon keeps spinning forever and there is nothing I can do to stop it or cancel. If I want to browse the store again I have to reload the website.

I attach 2 images of the Console logs. On the 2nd website I got some errors but dont know what they mean. The errors on the console appear when I click on the "Continue" button after filling the shipping information. Then the website freezes and the loading icon spins forever.

I've tried multiple times cleaning magento cache, browser cache, deploy static content, etc., but nothing works.

EDIT - New screenshot from Response tab:

It is worth mentioning again that the main store works perfectly fine. This issue occurs only in the 2nd store.

Complete code from response tab:

{"payment_methods":[{"code":"cashondelivery","title":"Pago en Oxxo / 7-Eleven"},{"code":"banktransfer","title":"Dep\u00f3sito o transferencia bancaria"}],"totals":{"grand_total":489,"base_grand_total":489,"subtotal":359,"base_subtotal":359,"discount_amount":0,"base_discount_amount":0,"subtotal_with_discount":359,"base_subtotal_with_discount":359,"shipping_amount":130,"base_shipping_amount":130,"shipping_discount_amount":0,"base_shipping_discount_amount":0,"tax_amount":0,"base_tax_amount":0,"weee_tax_applied_amount":null,"shipping_tax_amount":0,"base_shipping_tax_amount":0,"subtotal_incl_tax":359,"shipping_incl_tax":130,"base_shipping_incl_tax":130,"base_currency_code":"MXN","quote_currency_code":"MXN","items_qty":1,"items":[{"item_id":786,"price":359,"base_price":359,"qty":1,"row_total":359,"base_row_total":359,"row_total_with_discount":0,"tax_amount":0,"base_tax_amount":0,"tax_percent":0,"discount_amount":0,"base_discount_amount":0,"discount_percent":0,"price_incl_tax":359,"base_price_incl_tax":359,"row_total_incl_tax":359,"base_row_total_incl_tax":359,"options":"[]","weee_tax_applied_amount":null,"weee_tax_applied":null,"name":"Alcanc\u00eda de cer\u00e1mica"}],"total_segments":[{"code":"subtotal","title":"Subtotal","value":359},{"code":"shipping","title":"Shipping & Handling (Est\u00e1ndar - 1 a 4 d\u00edas h\u00e1biles)","value":130},{"code":"tax","title":"Impuestos","value":0,"extension_attributes":{"tax_grandtotal_details":[]}},{"code":"grand_total","title":"Total","value":489,"area":"footer"}]}}

NEW EDIT: Added response from estimateshipping xhr

Code:
[{"carrier_code":"tablerate","method_code":"bestway","carrier_title":"Est\u00e1ndar","method_title":"1 a 4 d\u00edas h\u00e1biles","amount":130,"base_amount":130,"available":true,"error_message":"","price_excl_tax":130,"price_incl_tax":130}]


texts: Why does magento 2 use hard coded "Factory" class?

texts:
As I've checked in Magento 2.3.1 Sales module there is one hardcoded Factory file in below path:

  vendor/magento/module-sales/Model/ResourceModel/Order/CollectionFactory.php

And in Cms module there is no Factory file available

  vendor/magento/module-cms/Model/ResourceModel/Block/Collection.php

I've read concept regarding factories which are automatically generated but I was surprised when I saw hardcoded Factory file. So just wanted to know the reason behind it.


texts: Catalog price rule for all products with qty > 0

texts: Is there a way to apply a catalog price rule to all products with qty > 0?


texts: Module or extension to detect conflicts in Magento 2

texts:
Is there an extension that detects conflicts between extensions or modules in general in Magento 2 ?

Like detect preferences added on the same class from 2 separate extensions.
Maybe detect 2 plugins that use around on the same class.

Or javascript declaration in requirejs-config.js that rewrites the same Jquery UI widget from Magento 2 base code. Or just replacing a JS file with other Magento 2 native 'rewrite' features.

I know that extension developers should 'rewrite' softly Magento 2 files but unfortunately they do 'rewrite' in the most convenient way.
It's back to Magento 1 rewrite days. This kind of tool would at least warn the developer. Such kind of tool exists already ?

I'm thinking Magento 2 itself should provide such kind of tool. It's their 'rewrite' system that gets broken by 3rd party.


texts: Something went wrong while saving the new password Magento 2

texts:
When I update my password with the "Reset my password" page, it shows me this error: "Something went wrong while saving the new password.".
Please check the screenshot.
I have tried to NULL the rp_token value, but it is not working.


texts:
I've created a functionality to search customers based on their address attributes.

To achieve this, I have created a customer collection (joining shipping and billing attributes) then added a filter according to the user input.

here's the code:

    $collection = Mage::getResourceModel('customer/customer_collection')
        ->addAttributeToSelect('uuid')
        ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
        ->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
        ->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')

        ->joinAttribute('shipping_postcode', 'customer_address/postcode', 'default_shipping', null, 'left')
        ->joinAttribute('shipping_city', 'customer_address/city', 'default_shipping', null, 'left')
        ->joinAttribute('shipping_region', 'customer_address/region', 'default_shipping', null, 'left')
        ->addAttributeToFilter( array(
                                    array('attribute' => 'billing_'.$this->getAttribute(),$opsymb => $value),
                                    array('attribute' => 'shipping_'.$this->getAttribute(),$opsymb => $value)
                                ));

I am able to search on both billing as well as shipping address. However, if address is neither billing nor shipping (no radio button selected - backend), then that address is not considered in this search.

How do I include such address which is neither billing nor shipping in the collection?


texts: M1 - Remove shipping cost calculation from shoppingcart

texts:
In Magento 1 i want to hide the shipping costs from the shoppingcart view. So the totals that are visible should be without the shipping costs. Only when someone chooses to get the order delivered in the checkout process then they see the radio button with the extra costs for the shipping.

How can I achieve that?

Regards,


texts: Get sum of cart quantity of all options for a configurable product on cart page

texts:
I want to get sum of qty of all variations present in cart for a configurable product. For ex.- see below image--

'WHEY PROTEIN ISOLATE-WPI' is a configuration product. In cart it has 2 different variations with qty 1 and 2.

I want to get its total qty i.e 3 (1+2) on same page (cart page), how can I get it.

Although I can do it by looping for each item in cart but it will slow down the cart page, so if any one can suggest another way to do it.

Any idea ?


texts: Magento 2.3 render first level subcategory grid with images on category page

texts:
Hi I want to render sub categories grid with images.
Using below code in products.phtml but it renders all levels sub-categories.

<?php $category = $block->getCurrentCategory();
  $subcategories = $category->getChildrenCategories();
  $_helper = $this->helper('Magento\Catalog\Helper\Output');
  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
  if(count($subcategories) > 0): ?>

        <?php foreach($category->getChildrenCategories() as $subcategory): ?>
            <?php $subcategory = $objectManager->create('Magento\Catalog\Model\Category')->load($subcategory->getId()); ?>

                    <?php if ($_imgUrl = $subcategory->getImageUrl()): ?>
                        <a href="<?= $subcategory->getUrl() ?>" class="product photo product-item-photo">

                                <?php $_imgHtml = ''; ?>
                                <?php echo $_imgHtml = $_helper->categoryAttribute($subcategory, $_imgHtml, 'image'); ?>

                    <?php endif; ?>

                            <a class="product-item-link" href="<?= $subcategory->getUrl() ?>"><?= $subcategory->getName() ?>

        <?php endforeach; ?>

<?php else: ?>
<?php if (!$block->isContentMode() || $block->isMixedMode()): ?>
    <?= $block->getProductListHtml() ?>
<?php endif; ?>

But I want to render just the next level child and similar on sub category page.


texts:
I am new to Magento and I am trying to change the address where my public ip directs, but honestly do not quite know how to do it. So if anyone could lend a hand it would be much appreciated.

I have an ip, let´s say http://12.34.456.89/ and when I navigate to it from browser I end up in the first magento page (Concratulations You are now running Bitnami Magento 1.9.0.1-0 virtual appliance. blaa, blaa), but I would need it redirect into http://12.34.456.89/magento/ where the actual store resides.

How can I make the the redirection so, that upon entering http://12.34.456.89/ on the browser, user will end up on http://12.34.456.89/magento ?

Many thanks for helping a newbie out.


texts: How to remove the category with search bar in Magento 2

texts:
How to remove the categories drop down with title "All categories" attached with the search bar seen in the image attached herewith in Magento 2 ?

We just need to show the search bar only and no category list along with.

                  <?php if($catalogsearch) : ?>

                    <?php echo __('All Categories') ?>

                      <input style="display:none;" type="text" value="" id="qsearch">

                        <?php
                        if($depth) $depth ++;
                          $categoryFactory = $objectManager->create('Magiccart\Alothemes\Model\System\Config\CatalogSearch');
                            $categories = $categoryFactory->toOptionArray($depth);
                            echo '
' . __('All Categories') . '
';
                            foreach ($categories as $category){
                              echo '
' . $category['label'] . '
';
                            }
                        ?>

From this code, where can I set the catelogsearch as false ?


texts:
How to rename the image file name before upload database and Media Folder

 public function fanbookAction(){
        $img = ''.$this->getRequest()->getPost('img');
                if(isset($_FILES['img']['name']))
                {
                    try{
                        $uploader = new Varien_File_Uploader('img');
                        $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); // Your Format Here
                        $uploader->setAllowRenameFiles(true);
                        $uploader->setFilesDispersion(false);
                        $path = Mage::getBaseDir('media').DS.'FanBook'.DS;
                        $destFile = $path.'/'.str_replace(' ','_',$_FILES['img']['name']);
                        $filename = $uploader->getNewFileName($destFile);
                        $uploader->save($path, $filename);
                        $img ='FanBook/'.$filename;
                        $collection = Mage::getModel('fanbook/fanbook');
                        $collection ->setData('img',$img);
                        $collection->save();

                        $this->_redirectReferer();
                        Mage::getSingleton('core/session')->addSuccess('Your Request has been Completed Successfully');
                    }

                    catch(Exception $e) {

                    }

                }
    }


texts: View Product name in customer area, right beside order number

texts: someone did know a solution: Is it possible, to show the Product name in customer area, right beside order number?


texts: Magento Custom Page Templates Not Appearing in Dropdown Menu

texts:
I'm attempting to create a custom page layout for a Magento site I'm building, but having the most difficult time in the world getting the template to actually appear in the dropdown menu when I create a page. I've tried repeatedly, using different sources, to get this to work, and have no idea where to go from here.

The most annoying part of this is that it works just fine on my local copy of Magento. When I move the exact same code to my remote hosting, however, it no longer shows up in the list.

Here's an example of one of the layouts I've tried to create:

/app/code/local/custom/layouts/etc/config.xml:

<?xml version="1.0"?>
<config>
     <modules>
        <custom_layouts>
            <version>0.1.0</version>
        </custom_layouts>
     </modules>
     <global>
        <page>
            <layouts>
                <home_page_layout module="page" translate="label">
                 <label>Home Page Layout</label>
                 <template>page/home-layout.phtml</template>
                </home_page_layout>
           </layouts>
        </page>
    </global>
</config>

/app/etc/modules/custom_layouts.xml:

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

/app/design/frontend/THEME/default/template/page/home-layout.phtml:

CODE...

Any idea why this might not be properly appearing? I've double checked to see if the theme is correctly set in Magento too, but that didn't affect anything (obviously).


texts: Magento 2 Notice: Undefined index RendererFactory.php on line 64

texts:
Once per day I got my production server down with this error

  Notice: Undefined index
  ....vendor/magento/module-developer/Model/View/Page/Config/RendererFactory.php
  on line 64

I've checked config for dev/front_end_development_workflow/type and it exists in database also and as default config in xml.
Magento version 2.1.7

This error fixes with clearing cache but it's not a solution to do every time.
Does anybody faced with this issue?


texts: Magento2- restoreQuote() 502 Bad Gateway for Guest users

texts:
When I'm trying to do purchase as a Guest user,
Payment module calls $this->checkoutSession->restoreQuote(); while redirecting back to Magento store.

It will return 502 Bad gateway error only for guest users.

For registered users that works well.


texts: Include discount amount on subtotal in order export file Magento 2.2.2

texts:
I would like to export sales order from sales->Orders and the column subtotal(in csv and excel file) which should include the discount amount which we have apply while purchasing the product.

for example  i have subtotal as 133 in my current exported order file for this order i have aplayed a coupon which will reduce 20$ from the total amount so i have to show in subtotal as 133-20=113
in subtotal field it should show 113 instead of 133

Note:it should show only in exported file


texts: User automatically logged out by system after changing store

texts:
I have a multi-store web site for different cities. Users have an option to select their city and buy products available in that particular city. They have to register for buying products.

For sharing the information of customer data with all store, I configured the

System->Configuration->Customer Configuration->Account Sharing Option->Share Customer Account->Global

by doing this setting user can log in using their single login credential for any city, even if they register from there selected city. For example, if user X register after selecting Y city he/she can log in A city using the same login id and password successfully.

Now problem came when user login in the website after selecting any city and after this if user change city then they have to do login process again for that next selected city. For ex. if I select X city and log in and then if I select Y city I automatically logged out and again I have to log in for Y  city.

See the images for problem reference -

How can I fix this problem? For better understanding, you may visit RoyalCart

Any help will be appreciable. Thank you.


texts: How to remove value of magento 2 custom attribute through csv

texts:
I have created a custom product attribute named 'product_custom_label' on Magento ver. 2.1 which I been showing on product listing page. For updating its values I have provided the client with the CSV upload sheet like so:

sku | product_custom_label
d-12  new arrival
d-13  discounted

Updating the values is fine , but what I faced a problem is when I have to empty these values .

If I just remove the values from product_custom_label in the CSV, the attribute values are not emptied. I have already prepared a script to remove these values programatically but I wonder is not there a Magento way to remove/empty the values that we upload through csv?

The same problem is faced when I update the special price of the product.

So, is there any Magento way to empty out the value from a specific custom product attribute, or we just have to rely on mass edit functionality?


texts: How do I add a Magento search bar into a Wordpress site?

texts: I have a Magento site with a Wordpress blog under a sub directory. The header of the Magento site has a search bar and I would like to add the search bar to the header of the Wordpress site. How would I go about doing that? I know Fishpig does it but that removes too many other things I need.


texts: Set Custom "Star review rating" as required entry

texts:
I'm using Clickable star ratings for my e-commerce web site. I have followed the instructions provided within this tutorial:

http://blog.youbility.de/en/clickable-star-ratings-in-magento/

Now I'm trying to accomplished that star rating is required entry. So when I use the class name "required-entry" in the following code of line:

<input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio rating-input" />

just at the end of the code where is says: class=radio rading-input i have made the change so it looks: class=radio rading-input required-entry

Now star rating becomes required-entry, but it becomes required-entry for all the five starts - and i need to make five stars required-entry as one field.

Thanks.


texts: Magento2: issue with captcha in conact page

texts:
In stores --> Configuration --> Configuration customer --> Captcha I have enabled captcha also for "Contact page".

After open page contact us the captcha code form is not displayed.

When I try to send msg via this form then display:
"Incorrect captcha"


texts: Catalogsearch category filter not listing certain sub-sub categories

texts:
We have the following category tree:

Default Category

  | Shop categories

      | Sub category 1
      | Sub category 2
      | Sub category 3

  | Sale Corner

  | Another category

So it's like 1 Default Category, 3 Sub categories, and the Shop Categories (which is basically a sub category) has around 20 Sub Sub categories.

When I do a catalogsearch, I want it to Search inside the Sub Sub categories.

It now only searches in the sub categories.

It shows up in the results like this:

Shop By

Categories:

Shop Categories +

Sale Corner +

Another Category +

Whatever I try; anchoring the sub sub categories and not anchoring the 3 normal sub categories, it just won't display the sub sub categories. The only thing it will show when I anchor it is the name of the Shop categories.

I only have this problem with the catalogsearch, the normal navigation works fine.


texts:
I don't have access to server so I want to disable all magento crons from magento backend System menu>Configuration>System>Cron.

What values should I change here so that crons will never run? Setting it to 0 will do?

THanks!


texts: Add product to quote, if he has zero stock qty

texts: How i can add product (for example with 10 qty) to quote if this product has 0 stock qty.


texts: what is the fix for>> Parse error: syntax error, unexpected '?' in /home/uavpilot/public_html/app/Mage.php on line 615

texts:
I am getting the following error:

  Parse error: syntax error, unexpected '?' in /home/uavpilot/public_html/app/Mage.php on line 615

The confusing part, is that there is no -> ? <-  on line 615.
 - The UAVpilot in the path is my website folder on the host server, with magento installed at the root of public_html.
 - I verified prior to install that the server is able to run all of the
   patches and associated technologies for Magento.


texts: Cron stopped working after setting up multi store on Magento2

texts:
On Magento2 with the following setting on cPanel, cronjob was working.

/usr/local/bin/php /home/mystore/bin/magento cron:run |
grep -v "Ran jobs by schedule" >>
/home/mystore/var/log/magento.cron.log
/usr/local/bin/php /home/mystore/update/cron.php >> /home/mystore/var/log/update.cron.log
/usr/local/bin/php /home/mystore/bin/magento setup:cron:run >> /home/mystore/var/log/setup.cron.log

However, once I have set up multi store, it stopped.
How can I fix this?


texts: sales_order_grid is missing some orders that are in sales_order. How can the grid table be rebuilt? It does not appear part of the indexer or other cli commands.