texts: Related products in the addtocart.phtml?

texts:
I need to move the related products to

below the product options
and above the add to cart button

Is there a way to call the related products from within addtocart.phtml?

I tried moving the following out of view.phtml into addtocart.phtml but nothing shows

 if ($tmpHtml = trim($this->getChildHtml('catalog.product.related')))
     echo '
'. $tmpHtml .'
';

Can anyone help with this.


texts:
i've faced with magento2 and gmail image proxy issue:
i'm sending transactional emails with images and gmail shows broken image because it has wrong URL inside (double dot in URL address):

it takes URL from Base URL and of course it correct and always was.
moreover, any other shipment and/or payment method works ok.

Kindly asking about any hints or suggestions.

p.s. same with some products:


texts: How can I create a multilanguage multistore?

texts:
I want to create two new shops beside my current one. The domain should be the same, but I want to add some suffixes to the domain for the other two stores.
So I want a shop structure like the following:

Multistores:

Shop 1: example.com/
Shop 2: example.com/eu/
Shop 3: example.com/us/

Multilanguages:

Shop 2: example.com/eu/en/
Shop 2: example.com/eu/fr/

Shop 3: example.com/us/en/
Shop 3: example.com/us/fr/

For this reason I have created the following structure inside the magento backend:

Shop 2 (code: base_eu)          Store EU                German (code: eu_de)
                                                        English (code: eu_en)

Shop 3 (code: base_us)          Store US                German (code: us_de)
                                                        English (code: us_en)

Furthermore I have created two subdirectories inside my magento root folder (eu/ and us/) which represents
the "Shop 2" and "Shop 3" and I have changed the base url of this two shops to example.com/eu/ and example.com/us/.

In Addition I have created a lot of symlinks (app, errors, includes, js, lib, media, skin, var, index.php)
and I have copied the .htaccess inside the subdirectories eu/ and us/.

After this I have modified the htaccess files in both folders:

eu/.htaccess -> SetEnv MAGE_RUN_CODE eu_de
us/.htaccess -> SetEnv MAGE_RUN_CODE us_de

So the default store view of both pages is the german store view.

A another solution is to edit the index.php of both directories and add something like this:

$mageRunCode = 'base_eu';
$mageRunType = 'website';
Mage::run($mageRunCode, $mageRunType);

So I can avoid the htaccess changes, but the result would be the same.

This works great so far, but how can I add the other store views now? Should I add another subdirectories inside the directories for each language or is there a better way to do this?

EDIT

I have tried something like this now:

magento_root
    app
    ...
    eu
      (symlinks app, media, ...)
      index.php
      .htaccess
      en
        (symlinks app, media, ...)
        index.php
        .htaccess

It's working so far, but this seems to be a little bit tricky.


texts: jquery validation(length & numbers) for phone number

texts:
I have created field as required. I tried some ways to validate input and length it's not working.

my functions is:

function Validate(code){
            if(jQuery('#'+'shipping_form_'+code).length != 0){
                jQuery('#'+'shipping_form_'+code).show();
                jQuery(this).find('.required-entry').attr('disabled','false');
               /* if(jQuery(this).find('.required-entry').length < 11){
                    alert('Account Number should be 6 digits')
                */}
            }
        }

How to validate length & input(numbers only)?

Thanks.


texts: Sanitizing HTML output in templates in 2.4

texts:
Before 2.4 the way you could sanitize an html value in a template was to use $block->escapeHtml($valueHere);.
Where $blick is the instance of the current block.
This still works in 2.4, but the method is deprecated.
/**
 * Escape HTML entities
 *
 * @param string|array $data
 * @param array|null $allowedTags
 * @return string
 * @deprecated Use $escaper directly in templates and in blocks.
 */
public function escapeHtml($data, $allowedTags = null)
{
    return $this->_escaper->escapeHtml($data, $allowedTags);
}

The recommendation is to use the escaper directly in the templates.
But I cannot add the escaper instance as a view model in the template because Magento\Framework\Escaper does not implement Magento\Framework\View\Element\Block\ArgumentInterface.
So if I do this in my layout files
<block ...>
    <arguments>
        <argument name="escaper" xsi:type="object">Magento\Framework\Escaper</argument>
    </arguments>
</block>

I get an exception

Instance of Magento\Framework\View\Element\Block\ArgumentInterface is expected, got Magento\Framework\Escaper instead.

Is there another clean way to use escape the html values in a template?


texts: Display more items per row in products/category pages

texts:
I am trying to display more products on a single row. I don't know where I could do that? For now, it displays only 3 products per row and there is a lot of empty space.

I would like to display 5 products per row.


texts: Magento HTACCESS query 301 redirect all but admin

texts:
Hi hopefully someone can help.
I have added a 301 redirect to change from an old domain name to a new domain.
The magento build is still on the old domain also (but with no follow / no index)

I want to keep the installation on the old domain also for order reference etc.

I have added the following to the hta access file, but obviously this also stops me being able to access the admin side of the site.

How can I add an exclude on the following so that I can redirect all - apart from the admin and so this can still be accessed.

#Redirect from old domain to new domain
RewriteEngine on
RewriteBase /
RewriteRule (.*) http://www.b.co/$1 [R=301,L]


texts:
For some reason the mini cart disappear from my website. I don't know why? and how do I debug it ?

this is the code from my layout:

<remove name="topMenu"/>
            <block type="experius_linkmanager/link_list" name="linkmanager.topnav" as="topMenu">
                <action method="setIdentifier"><key>hoesjes-topmenu</key></action>
                <action method="insert"><blockName>cart_sidebar</blockName></action>
            </block>

and this is from the header.phtml:

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

Any idea how do I debug this ? What should be the reason of disappearance ?
[UPDATE]
This is the structure of my theme:

frontend/mytheme/base/template/checkout/cart/sidebar.phtml
frontend/mytheme/default/template/ no checkout
frontend/mytheme/othername/template/checkout/ no cart folder


texts: How to translate "x has been added to your Wish List. Click here to continue shopping."

texts:
The string "x has been added to your Wish List. Click here to continue shopping." can be found in the template Magento/Wishlist/view/frontend/templates/messages/addProductSuccessMessage.phtml

But it doesn't the usual pattern

<?php /* @escapeNotVerified */ echo __('Some string you can translate') ?>

What should I write in my csv file?

Below the template file

<?php
echo $block
    ->escapeHtml(
        $block->getData('product_name')
    )
?> has been added to your Wish List. Click <a href="<?php
echo $block
    ->escapeUrl(
        $block->getData('referer')
    )
?>">here to continue shopping.

edit 02.09.2019

Since the question was asked, the template file has been updated to be translatable https://github.com/magento/magento2/commit/624173e59cdbb5f4203ce346b1b53637f32672ef#diff-7586a821ac9c752c277b0c4304885b76


texts: Magento 2 - Quesiton about the commented method in the beginning of the php file

texts:
I was looking for the implementation of setCarrier() and getCarrier(), what I found was in the beginning of Magento/Quote/Model/Quote/Address/Rate.php (link), but they are commented with no function body like below...

 * @method string getCarrier()
 * @method \Magento\Quote\Model\Quote\Address\Rate setCarrier(string $value)

And then I found a function using getCarrier() under the same php file, which is

public function importShippingRate(\Magento\Quote\Model\Quote\Address\RateResult\AbstractResult $rate)
    {
        if ($rate instanceof \Magento\Quote\Model\Quote\Address\RateResult\Error) {
            $this->setCode(
                $rate->getCarrier() . '_error'
            )->setCarrier(
                $rate->getCarrier()
            )->setCarrierTitle(
                $rate->getCarrierTitle()
            )->setErrorMessage(
                $rate->getErrorMessage()
            );
        } elseif ($rate instanceof \Magento\Quote\Model\Quote\Address\RateResult\Method) {
            $this->setCode(
                $rate->getCarrier() . '_' . $rate->getMethod()
            )->setCarrier(
                $rate->getCarrier()
            )->setCarrierTitle(
                $rate->getCarrierTitle()
            )->setMethod(
                $rate->getMethod()
            )->setMethodTitle(
                $rate->getMethodTitle()
            )->setMethodDescription(
                $rate->getMethodDescription()
            )->setPrice(
                $rate->getPrice()
            );
        }
        return $this;
    }

So I went to the \Magento\Quote\Model\Quote\Address\RateResult\AbstractResult, but the php file inside is this, an empty class.

I have checked the di.xml, but nothing related was found. Are those functions internally interpreted into some other functions?


texts: Magento 2: Display Product Attribute in CMS Page

texts:
I have created and product attribute which I am able to see it on Product View page i.e. addtocart.phtml

The below code work perfectly on product view page:

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

I have to read this variable in CMS Home page where same code is not working.

I tried with below code as well but no luck:

<?php echo $_item->getAttributeText('affiliate_link'); ?>

Do I have to do anything special to show product attributes on CMS page in magento 2?


texts:
I have create a ajax call for form submit.

But it returns error .......h.insertBefore is not a function

define(
        [
        'jquery',
        'uiComponent',
        'mage/validation'],
        function ($, Component, validation) {
        'use strict';

    return Component.extend({
        initialize: function ($options) {

            var msgLifetime = 4000;
            var $commentForm = $('#blog-post-comments');

            $commentForm.find('form').submit(function () {
                var $form = $(this);
                if ($form.validation() && $form.validation('isValid')) {
                    $form.find('[type=submit]').attr('disabled', 'disabled');
                    $.ajax({
                        'method': 'post',
                        'url': $form.attr('action'),
                        'dataType': 'json',
                        'data': $form.serialize(),
                        'success': function (res) {
                            if (res.success) {
                                $form.find('[type=submit]').removeAttr('disabled');
                               var h = '

' + res.message + '

';
                               h.insertBefore($form);
                                $form.hide();
                                setTimeout(function () {
                                    h.remove();
                                }, msgLifetime);

                            }
                        }
                    })
                }
                return false;
            });

          },

    });
    }
);


texts: Anyone ever seen this magento import images error?

texts: I was importing some images and I came accross this error, curious if anyone had a clue to what it is since I cannot search for someone else with the same error.


texts: Catalog price rule apply on products in different categories

texts:
I would need some help with Catalog Price Rules.
we're running Magento 2.4.0
There are following categories under root-category:
... Men
..... Underwear
...... Socks
We've product with SKU "1234" in both categories, Underwear and Socks.
There are 2 different catalog price rules:

12% on original for category "Underwear"
2 EUR fixed amount for category "Socks"

For some reason both rules are applied on the SKU in both categories.
Is there any way that SKU "1234" get's 12% in the one category and 2 EUR in the other category? So that the defined reduction is just valid for the category the SKU is assigned to?
Thanks for help.


texts: Can someone explain me the use of getHeaderText() method in magento

texts:
in block/adminhtml/items.php file there is one method

public function getHeaderText()
{
    $item = $this->_coreRegistry->registry('current_bhakti_magento2_items');
    if ($item->getId()) {
        return __("Edit Item '%1'", $this->escapeHtml($item->getName()));
    } else {
        return __('New Item');
    }
}

I dont get how it works.


texts:
How to call Plugin which already using the preference for vendor file in magento 2. I have already has preference which is overridding the some custom Magento controller, Now how can i use plugin to call my around method action in di.xml for same controller Action, can any one has any idea.
Thank In Advance.


texts: Where is the email template for the new user, created by admin from cms. Magento 2

texts:
I have to make an email template, that is sent when the administrator creates a new account. I made a template, but in cms I can't see where it is used. I was looking for it in:
- stores/configuration/customers/customers configuration
- stores/configuration/customers/advanced/admin

In vendor this template is called "new_user_notification.html".


texts: How can I enable WYSIWYG for product attribute field?

texts:
I want to enable the WYSIWYG editor on a custom product atribute. It displays on description and short description however not on the custom product attribute.

Does anyone know how I can do this?

Thanks!


texts: magento edit orders with processing status?

texts:
Is it possible to edit an order with status processing to add or remove products to this order before being shipped?

For example, a customer place an order, the order goes to status processing, and later the customer calls because he want to add/remove some product to the order. Can it be edited?


texts: Magento 2 - How I can made Tabs to be sticky

texts:
I have add tabs in the product view page:

<referenceBlock name="product.info.details">
    <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="product/view/attribute.phtml" group="detailed_info">
        <arguments>
            <argument name="at_call" xsi:type="string">getDescription</argument>
            <argument name="at_code" xsi:type="string">description</argument>
            <argument name="css_class" xsi:type="string">description</argument>
            <argument name="at_label" xsi:type="string">none</argument>
            <argument name="title" translate="true" xsi:type="string">Details</argument>
        </arguments>
    </block>
    <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="product/view/attributes.phtml" group="detailed_info">
        <arguments>
            <argument translate="true" name="title" xsi:type="string">More Information</argument>
        </arguments>
    </block>
</referenceBlock>

is there anyway to made this tabs to remain "sticky" / fixed at the top of the page when we scroll the page?

I try to do like this but is not work:

$(window).scroll(function () {
    if( $(window).scrollTop() > $('.product.data.items').offset().top && !($('.product.data.items').hasClass('sticky'))){
    $('.product.data.items').addClass('sticky');
    } else if ($(window).scrollTop() == 0){
    $('.product.data.items').removeClass('sticky');
    }
});

Thank you


texts:
In my Magento installation I have JQuery 1.10 already included but I need to have a newer version of it.

I added the latest version of JQery via the xml update tab in the cms page and I wrote my code in the content section of the cms page.

My code works but it breaks "the rest" of my javascript on that page, for example my language switcher does not work and the text in my search field disappeared.

Any idea how to solve that?


texts: Password reset link not working showing expired

texts:
When I'm trying to reset password through reset link from my mail, it's showing following error:

  Your password reset link has expired.

When I check my password reset link it looks like:

  http://example.com/index.php/customer/account/resetpassword/?id=327

the reset password token is not generating I've checked the reset password template and it's looking fine:

Reset Password

and I didn't update anything in my AccountController.php

public function changeForgottenAction()
{
    try {
        list($customerId, $resetPasswordLinkToken) = $this->_getRestorePasswordParameters($this->_getSession());
        $this->_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken);
        $this->loadLayout();
        $this->renderLayout();
    } catch (Exception $exception) {
        Mage::log($exception);
        $this->_getSession()->addError($this->_getHelper('customer')->__('Your password reset link has expired.'));
        $this->_redirect('*/*/forgotpassword');
    }
}


texts: Creating an order using REST with default shipping address

texts:
I read this document as reference to create an order using REST. But this tutorial have to always add shipping address. So, I use POST <host>/rest/V1/addresses to add / edit customer address and fill "default_shipping": true in body request to set default shipping address. I expect that the step to create the order is

POST <host>/rest/<store_code>/V1/carts/mine/items for adding a product to cart
POST <host>/rest/<store_code>/V1/carts/mine/payment-information for create an order with body request as { "paymentMethod": { "method": "checkmo" } }

But it returns The shipping address is missing. Set the address and try again.
I'm sure my default shipping address is settle. I check by

default_shipping value from GET <host>/rest/V1/customers/me
"Default Shipping Address" in my magento website

Did I do somethings wrong somewhere? Thank you in advance for answers.


texts: Owebia shipping method missing from shipping method list

texts:
I have been successfully installing Owebia_AdvancedShipping into my website. So as, the Owebia area is appearing in my backoffice and contain some configuration.
But when it comes to the frontend or when I list the shipping methods it's missing.
In config.php it's appearing with something like that (with more methods)
            'owsh1' => [
                'active' => '1',
                'model' => 'Owebia\\AdvancedShipping\\Model\\Carrier',
                'title' => 'Advanced Shipping by Owebia',
                'required_fields' => 'postcode,country_id',
                'config' => 'addMethod(\'id_001\',[
 \'title\'  => \'Livraison Colissimo 48h\',
 \'description\' => \'Livraison Colissimo 48h\',
 \'enabled\' => $quote->subtotal_with_discount < 50,
 \'price\' => 4,90 ])
->set(\'header\', "Livraison Colissimo 48h payante")
->set(\'popup\', "Livraison Colissimo 48h payante");

And like this in the admin

In frontend the method is missing.
And if I try this to see what methods are recognized, it seems that owebia (owsh1) isn't there neither.
    $methods = $this->shippingMethods->toOptionArray();
    foreach ($methods as $k => $method){
        var_dump($k);
    }

Thought I suspect the first line to be owebia...but with a wrong configuration.
int(0)
string(3) "dhl"
string(5) "fedex"
string(7) "instore"
string(8) "flatrate"
string(9) "tablerate"
string(12) "freeshipping"
string(3) "ups"
string(4) "usps"


texts: I want to remove Print Invoices from mass action select menu available on order view page in admin order panel.


texts: How to get admin config values in the root folder

texts:
I need to get admin values to a PHP file located in Magento 2 root folder.

In Magento 1 I could do it by:

require ('./../../app/Mage.php');

How can I do this in Magento 2?


texts: How to pre-warm the cache for all customer groups programatically?

texts:
By default Magento caches the pages that are accessed by the user. The pages are cached in different versions corresponding to the customer group, if the customer is logged in, which store view and currency is configured.
Based on these attribute values the value for the X-Magento-Vary cookies is being generated and this helps to identify which of the cached versions of the specific page should be used.

We would like to pre-cache all instances for all pages, but do not know how to access all pages for all of the above mentioned combination.

However, to keep things simple, lets assume we only want to pre-cache all pages for all customer groups and if a customer is logged in. Through PHP's file_get_contents() function we are able to pre-cache all pages,but only for never logged in users / users that have no cookies, yet.

Does someone know if it is possible to load the page for a specific combination of customer_group and customer_logged_in attributes?
If it is possible, we assume that we have to provide the data for context parameter of the file_get_contents() function. Has someone an idea what data we have to provide? We already tried to manually set the X-Magento-Vary cookie with a value for a specific combination but this is not the trick.

We appreciate any help! :)


texts: Magento 2 : How to Import Additional Attributes and Images

texts:
I am trying to import csv in Magento 2. There are no errors given by Magento while importing, but column additional_attributes is totally ignored and additional_images is ignored if it contains multiple values. I used following import options:

Field divider: ,
Value divider: |
Fields enclosure: active

The csv looks like, this:
sku,additional_attributes,additional_images
123,"manufacturer=ABC,material=Wood|Metal,color=red","2.png,3.png"

Why are those values getting ignored?
Edit: If I deactivate the fields enclosure checkfield I receive the following error:
1. Value for 'manufacturer' attribute contains incorrect value, see acceptable values on settings specified for Admin in row(s): 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1

The values equals exactly the value specified for that attribute in the backend.
SOLUTION: I replaced al the | with a , in my csv except for the additional_attributes column. During the import I used the default configuration, both delimiters as , field enclosure checkbox unchecked. Now it is working.


texts: programatically created bundled product : option and product do not show on frontend unless saved from admin

texts:
i have programmatically created bundled product and also able to add selection and option data to it, but my problem is that product is not visible in front end. when i save that product even without changing the any of the fields in admin, it starts getting displayed.

i am stuck and have no idea what to do if you have any idea please help me out. below is the code is used

$storeID = 0;
$websiteIDs = array(1);
$cats = array(19);

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

/** @var $productCheck Mage_Catalog_Model_Product */
$productCheck = Mage::getModel('catalog/product');

$p = array(
        'sku_type' => 1, //0 = dynamic, 1 = fixed
        'sku' => '687',
        'name' => "BarProduct",
        'description' => 'Foo',
        'short_description' => 'Bar',
        'type_id' => 'bundle',
        'attribute_set_id' => 4,
        'weight_type' => 0, //0 = dynamic, 1 = fixed
        'visibility' => 4,
        'price_type' => 0, //0 = dynamic, 1 = fixed
        'price_view' => 0, //0 = as low as, 1 = price range <---- DOES NOT SEEM TO HAVE ANY EFFECT
        'status' => 1,
        'category_ids' => $cats,
        'store_id' => $storeID,
        'website_ids' => $websiteIDs
);
$productCheck->setData($p);
$productCheck->setStockData(array(
        'is_in_stock' => 1,
        'qty' => 1
    ));

Mage::register('product', $productCheck);

$selectionRawData = array();
$selectionRawData[0] = array();

$optionRawData = array();
$ChildProduct = array(1,2);
$i = 0;
foreach ($ChildProduct as $child){
    $optionRawData[$i] = array(
            'required' => 1,
            'option_id' => '',
            'position' => 0,
            'type' => 'select',
            'title' => 'FooOption',
            'default_title' => 'FooOption',
            'delete' => '',
    );

    $selectionRawData[$i][0] = array(
            'product_id' => $child,
            'selection_qty' => 1,
            'selection_can_change_qty' => 0,  // 1-> yes, 0 -> no
            'position' => 0,
            'is_default' => 1,
            'selection_id' => '',
            'selection_price_type' => 0,
            'selection_price_value' => 0.0,
            'option_id' => '',
            'delete' => ''
    );

$i++;
}

Mage::register('productCheck', $productCheck);
Mage::register('current_product', $productCheck);
$productCheck->setCanSaveConfigurableAttributes(false);
$productCheck->setCanSaveCustomOptions(true);
$productCheck->setCanSaveBundleSelections(true);
// Set the Bundle Options
$productCheck->setBundleOptionsData($optionRawData);
//set option data
$productCheck->setBundleSelectionsData($selectionRawData);

$productCheck->setAffectBundleProductSelections(true);

$productCheck->save();


texts: How we can add .scss file for our custom module ? How it will compile to styles.css in Magento 1.9.2.1?

texts:
Default RWD interface using a skin\frontend\rwd\default\scss folder. These group of files convert their style code into single styles.css file which located at skin\frontend\rwd\default\css\styles.css

How such .scss files get converting their style into styles.css file ?


texts:
I'm working on a magento 1.9 payment gateway extension.

It have a little form on payment method step and when we fill and clickon next button it validate

after validate it call to this function

/public_html/app/code/community/Shopworks/Billink/Model/Payment/Method.php

private function throwPaymentException($errorMessage)
    {
        //Because OSC does not show the errorMessage from the exception, we also store the error in the session. This
        //way we can collect it from the session and display it in the form.
        $_SESSION[self::VALIDATION_MESSAGE] = $errorMessage;

        //Throw the exception
        $errorMessageField = 'p_method_' . self::PAYMENT_METHOD_BILLINK_CODE;

             // Mage::throwException($errorMessage);
        throw new Mage_Payment_Exception($errorMessage, $errorMessageField);
    }

But problem is when fields are not valid, checkout redirects to cart page
(the error return from ajax is 503 error when call "Mage_Payment_Exception")

I tested by remove Exception handler code, then checkout load next step without shows any errors.

Payment class image

Anyone know how to show the errors which return by validator without redirects to cart page or go to next checkout step, Thank You


texts: How to use this attributes in my custom form ui component


texts:
I'm trying to create a minimum total checkout module that will prevent someone from checking out with a total less than a configurable amount.

I'm using the event sales_quote_save_before to display an error on the checkout/cart page when it's opened.

<?xml version="1.0"?>
<config>
    <frontend>
        <events>
            <sales_quote_save_before>
                <observers>
                    <b2b>
                        <class>b2b/observer</class>
                        <method>checkTotalsCart</method>
                    </b2b>
                </observers>
            </sales_quote_save_before>
        </events>
    </frontend>
</config>

And in the observer

public function checkTotalsCart()
{
    if ($this->_hasCartError()) { /* does some checks, returns bool */
        $this->_setErrorMessage();
    }
}
protected function _setErrorMessage()
{
    $session = Mage::getSingleton("b2b/session"); /* extends Mage_Core_Model_Session */
    $session->addError($this->helper->getErrorMessage());
}

The problem is that when you update the cart from the cart page, the error message is showing up twice.  I guess that event is happening multiple times.

I've tried to check if the message was previously set with a custom session variable

protected function _setErrorMessage()
{
    $session = Mage::getSingleton("b2b/session");
    if ($session->isErrorMessageAdded()) {
        return;
    }
    $session->addError($this->helper->getErrorMessage());
    $session->isErrorMessageAdded(true);
}

But that didn't work either.  How can I make sure an error message is only showing up once per page request?

Relevant Module files

etc/config.xml
Helper/Data.php
Model/Observer.php
Model/Session.php

More


texts: How to move add to cart button after the short description in product listing page

texts: How to move add to cart, compare, wish list section after the short description in product listing page.


texts: Custom category attribute is not showing in magento2

texts:
I have created the custom attribute using the solution given here.

Create Custom category Yes/No attribute magento2

The attribute is created and i can see entry in database eav_attribute table.

But when i open the individual category in admin panel. The new custom attribute which is created is not showing up. Please anyone help me is any other setting i need to do?


texts: Magento 2.1: Unable to import production images using "additional_images" column

texts:
According to Magento 2 dev guide on importing product images, we should be able to add additional images to the column additional_images using full URLs.
However, when I created an import csv file with the following example:

sku, additional_images
ExistingProdSKU1, http://someexistingwebsite.com/existingimage.jpg

I got a validation error for Column names: "additional_images " are invalid. I did not have any issue with base_image, small_image, and thumbnail_image, though. Have there been any changes on how we can import additional images to existing products on the catalog? Note that I'm currently running Magento 2.1.2.


texts:
Onepage checkout is not working. When i do research I found out that it is not actually getting the JS. link: http://farmafrique.com/index.php/checkout/onepage/

Does anyone have any solution to this?


texts: Magento2 : can i add search bar on top on layered navigation bar on category page

texts: how can i add search bar on left bar in category page.


texts: Use group price in shopping cart price rule conditions

texts:
Is there a properly way to use the product "group price" in the "shopping cart price rules" conditions, like the special_price attribute?

For some of my "shopping cart rules", I need to exclude from products that have special_price AND products that have group_price defined.

For the special_price, it is working out of the box.

Someone has probably already had the same requirement?

Thanks in advance for the feedback.


texts: Free Magento connect extensions showing as currently unavailable on Conenct

texts:
We have had some extensions available on Magento Connect for a reasonable amount of time (over a year). Last month all the free ones started showing "This extension is currently unavailable on Magento Connect. Please contact the developer."

As the developer, we had no idea why this had occurred. When we contacted Magento Connect they tried to suggest that we had uploaded something incorrectly. Obviously this is not the case, as these extensions have been downloaded and used by plenty of people without any difficulty. We have all these extensions on github, but it is now almost a month that they have not been available on the Connect site.

Our paid extensions still link correctly to our shop, and all of the extension are listed in our connect account as "live". So this isn't a matter of them not having been accepted yet.

Any idea what this message might mean or how it might happen?


texts: magento2: how to set link to specific tab in product?

texts:
My product page has 3 tabs (Details, More information, Reviews).
When you go to the product page the Details tab is initially open.
I'd like to be able to link directly to second tab (More information).
problem is that url like #additional works only when this tab is opened.

Will really appreciate if someone guide me how to compose right link.


texts: Magento 2 : how to create customer using REST API?

texts:
I want to create customer using REST API in magento2. I am following this swagger link , but only method is given in this. How to pass parameters of customer in REST API?

Help me in this.


texts:
Currently, when I open a product page, I am presented with three buttons

Add to Wishlist
Add to Compare
And Share

If I click share, it redirects me to a login page.  Why a person needs to be logged in in order to share something, I have no idea.  Is there a reason for this?  Can I fix this?

The only fix I have come up with is to use an extension call AddTo.

Here is a picture

If I click "Share", I am redirected to login.


texts: Magento2. Adding custom attribute category put category name below

texts:
I successfully added a new image field to category product. This is the category_form.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="content">
        <field name="product_page_background">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="source" xsi:type="string">category</item>
                    <item name="label" xsi:type="string" translate="true">Background Product Page</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="formElement" xsi:type="string">fileUploader</item>
                    <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                    <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
                    <item name="required" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">45</item>
                    <item name="uploaderConfig" xsi:type="array">
                        <item name="url" xsi:type="url" path="custom/products/adminhtml/category/productbackground/upload"/>
                    </item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

This make the input category name in the background going under the Content Tab:

How can put the category name input back to the top?


texts: Hide attribute for configurable product in frontend

texts: I have a configurable product which shows 4 dropdowns in the frontend on the product detail page. I'd like to hide some of them, and was hoping to achieve this using "Visible on Product View Page on Front-end" setting for the attributes, but they still appear in the frontend. Any help would be greatly appreciated!


texts:
I have two two entities news and authors, and I also can to create news and authors. So when I create my news I want to display authors-list in my form "select"

After that I need to display it in my grid

The problem is that news are stored in table news but authors in table authors
Can somebody help mith it?

code

/**
 * Create table authors
 *
 */
$installer->getConnection()->dropTable($installer->getTable('tasknews/authors'));
$table = $installer->getConnection()
    ->newTable($installer->getTable('tasknews/authors'))
    ->addColumn('authors_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
        'identity'  => true,
        'nullable'  => false,
        'primary'   => true,
    ), 'Authors ID')
    ->addColumn('authors', Varien_Db_Ddl_Table::TYPE_TEXT, '255', array(
        'nullable'  => false,
    ))
    ->addColumn('created', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
        'nullable'  => false,
        'format' => 'yyyy-MM-dd',
    ));
$installer->getConnection()->createTable($table);

/**
 * Create table news
 *
 */
$installer->getConnection()->dropTable($installer->getTable('tasknews/news'));
$table = $installer->getConnection()
    ->newTable($installer->getTable('tasknews/news'))
    ->addColumn('news_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'nullable'  => false,
        'primary'   => true,
        ))
//    ->addColumn('authors_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
//        'nullable'  => false,
//    ), 'Authors ID')
    ->addColumn('title', Varien_Db_Ddl_Table::TYPE_TEXT, '255', array(
        'nullable'  => false,
        ))
    ->addColumn('description', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        'nullable'  => false,
        ))
    ->addColumn('created', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
        'nullable'  => false,
        'format' => 'yyyy-MM-dd',
    ))
    ->addColumn('is_active', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
    'nullable'  => false,
    'default'   => '1',
    ), 'Is Block Active');
//    ->addForeignKey($installer->getFkName('tasknews/news', 'authors_id', 'tasknews/authors', 'authors_id'),
//        'authors_id', $installer->getTable('tasknews/authors'), 'authors_id',
//        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE);
$installer->getConnection()->createTable($table);


texts: Magento 2: Add loading effect on remove product from the mini cart

texts:
I want to add loading effect before ajax call of remove product from the mini cart.

Right now when I remove the product from the cart, It takes 4-5 seconds to delete but user cannot identify whether the process is going on or not.

I tried to find JS file for the responsible code but not able to find it.

Does anyone have an idea which JS file contains code to call AJAX to remove the product from the cart?


texts: Magento 2.1 Web Setup Wizard Frozen to remove an extension

texts:
I installed the application YOTPO.  Then decided to remove it.
The system is now stuck at this screen.  Therefore every time I go to SYSTEM > WEB SETUP WIZARD, it brings me to this screen and I can not get out...

THIS IS FROM THE CONSOLE BOX:  Please Let me know if it is too much

  [2017-03-15 19:02:04 UTC] Job "setup:cache:enable ["config layout
  block_html collections reflection db_ddl eav customer_notification
  full_page config_integration config_integration_api translate
  config_webservice"]" has been successfully completed [2017-03-16
  20:16:32 UTC] WARNING: There is a problem with backup files!
  Performing rollback from these files may cause the Magento application
  to be unstable [2017-03-16 20:16:32 UTC] Backup file does not exist
  for "db" [2017-04-17 23:02:02 UTC] Job "rollback
  {"backup_file_name":"/home/tackworx/public_html/var/backups/1489555456_filesystem_code.tgz"}"
  has been started [2017-04-17 23:02:02 UTC] Restoring archive from
  "/home/tackworx/public_html/var/backups/1489555456_filesystem_code.tgz"
  ...

  [2017-05-03 16:02:02 UTC] Update is already in progress. [2017-05-03
  17:02:02 UTC] Update is already in progress. [2017-05-03 18:02:02 UTC]
  Update is already in progress. [2017-05-03 19:02:02 UTC] Update is
  already in progress.


texts:
Right,

Well on the Checkout page, for some reason nearly every FREE/Default theme has placed this in the COL-2 div class underneth the discount code. I can't express how ugly this looks, anyway's what file (phtml / XML) do i need to edit to get it into the COL-1 div..

I've used inspector mode in chrome to copy n paste the code where i want it, to give you guys an idea of what i want to do...

I want to do the same for the colour options (again its just above the description module and full length of the screen, why colour swatch isnt hardcoded as standard is beyond me).

I want to remove the options div box on that and place it just under the price ... anyways, checkout is more important atm...


texts: magento 2: While magento data migrate from magento 1 to 2 , is there customer password working?

texts: While migrating data from Magento 1 to Magento 2, do we lose customer password? I mean, Is customer password working when we migrate Magento 1 to Magento 2 using data migrate tools or need to reset that?


texts: B2B Multiple warehouse management for sellers and shipping from multiple warehouses in magento2

texts:
single vendor multiple warehouse concept in B2B. Like vendors, warehouses should be located in different cities.
Is there any extension available for this and any idea about this.
Multiple warehouse management for sellers and shipping from multiple warehouses.
Example: Asian paints have two warehouses. Warehouse A and Warehouse B
If an order is placed, I can ship from A or B.
The warehouse will have products. If I shop from that warehouse then stock gets reduced from there.
Any help would be appreciated.


texts: How to get the original price Product SaveBefore

texts:
Within an observer running before saving a product change in the admin area, how can I get the price of the product before saving?

Using $observer->getProduct()->getPrice() I have the new price which has not been saved yet, but I don't know how to get the old one.

In this observer I need both prices, old and new one.


texts: Magento 2: swatch images loading ONLY thumbnails

texts:
I'm using Magento 2.3.3 and I have a very annoying problem with the swatches.

When I click on size/color, the picture will show the standard placeholder, but if I take a look at the json, the picture will be generated ONLY as a thumbnails: large and medium are not found and for this reason, magento shows the placeholder.

Here is the picture

And here is the json:

The weird thing is that the pictures are generated in the cache, but Magento doesn't get them.
I tried to change the view.xml of the theme. I tried doing the catalog:images:resize. Nothing!

This problem is driving me crazy! I need your help

Thanks!


texts:
When a user clicks "Add to Wishlist" on a product that uses swatching, it saves the configurable product ID, not the simple product id. How can I get it to save the simple product id in the wish list tables?

I have looked at several other questions on Stack Exchange and none of them appear to address this issue:

Add Product to Wishlist with a Selected Custom option

Magento 1.6.2 Adding Configurable Product in Wishlist : How to check whether or not all required fields are filled before adding to wishlist

mangento add product options into wishlist

I think most of these solutions are if the options are not set as swatches.

I would appreciate any suggestions. Thanks.

Question: What changes in the code do I need to make in order to save the simple product id to the wish list instead of the configurable product id?


texts: Discount and transaction fee as separate rows on checkout

texts:
We have a Magento Community Edition 1.9.2.1 which has a discount rule set up via Shopping Cart Price rules. Next to that, depending on the payment method, transaction and processing fees are also applied.

Currently this is shown as 1 line on the checkout:

Is there any way to show these as separate rows on the checkout and in the order confirmation e-mails? Our sales support team needs to know the separate amounts for the discount and transaction / processing fee.

Thanks in advance,

Stijn


texts: Magento 2: where is the update/cron.php file?

texts:
Following this interesting question from Fabian: Reasons to setup cronjob for setup:cron:run and update/cron.php on a deployed production system?

I've discovered that my Magento 2 installed via GitHub does not have the update/cron.php file.

Edit: my install does not have an update folder at all.

Where does that file come from ? How can I get it when installing from GitHub ?


texts:
Is it possible to set magento store view with help of store id and store code programmatically?

$store = Mage::getModel('core/store')->load($store_id);
$code  = $store->getCode();

With the help of above code I can able to get store code. Now how to set store view with the help of id and code? I tried searching for solution but couldn't able to find it.


texts: Delete operation is forbidden for current area error when creating account from checkout success page

texts:
When creating an account from the checkout success page the following error is shown.

"Delete operation is forbidden for current area"

Console shows:

Failed to load resource: the server responded with a status of 503 (Service Unavailable) /checkout/account/create/

Error in the logs for this page reads:

a:4:{i:0;s:71:"A customer with the same email already exists in an associated website.";i:1;s:10181:"#0

This is a completely new email address, however. I have tried replicating this issue on a separate server to try and debug this.

This does not seem to be a problem with any code or modifications made by me I'm starting to think it is just a bug as after multiple attempts to replicate on almost Vanilla Magento 2 I think Its simply that if Address line 2 is left blank. Can anyone else replicate this on Magento 2.1.6?


texts: Is magento2 remove="true" global like in mage1?

texts:
In magento1 the remove tag was global and once a block was removed it could never be added back in:

<remove name="catalog.compare.sidebar" />

Is the same true in magento2?

<referenceBlock name="catalog.compare.sidebar" remove="true" />


texts: Add custom images div like this sample app block. How can we create it for our custom theme ?


texts: Setting varnish full page cache settings via environment variables

texts:
I'm trying to set the varnish settings through environmental variables. I have the following ones set:
CONFIG__DEFAULT__SYSTEM__FULL_PAGE_CACHE__VARNISH__BACKEND_HOST: varnish-service
CONFIG__DEFAULT__SYSTEM__FULL_PAGE_CACHE__VARNISH__BACKEND_PORT: 8090

If I go to the settings for Full Page Cache I can verify that it's set to the above mentioned values. See image below.

My problem comes when I'm trying to run bin/magento cache:clean. In my system.log I get the following error: main.CRITICAL: Unable to connect to varnish:80 . Error #0: stream_socket_client(): unable to connect to varnish:80. As you can see these values are not respected when cleaning the cache.
To solve this for now I need to run bin/magento setup:config:set --http-cache-hosts=varnish-service:8090 which solves the issue but I would still like Magento2 to respect the values I set through the environment variables so I can control it without running commands on the containers.
Magento version is 2.3.1 and I'm running my containers in Kubernetes.


texts:
I have two store views Magento 1.9

http://www.1guru4you.com/

http://www.1guru4you.com/gr

If i type in the URL field http://www.1guru4you.com/gr , it redirects me to http://www.1guru4you.com/.

This behavior is a problem for me. How can i solve it.
Thank you


texts: How to override de.xml available in vendor/magento/zendframework1/library/Zend/Locale/Data/ in 2.4.2

texts:
I want to change the currency position and change date formatting as well
Does any one know how to override this file in custom module in my case it is de.xml?
What I want to make changes?

Date format
Currency position
Percentage position

Already referred -
https://stackoverflow.com/questions/39384750/magento-2-how-to-customize-currency-symbol-and-format-based-on-locale/39410383
How to override core vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml


texts: Magento 2.2 - Products sort by URL issue

texts:
I am facing category page url issue when try to sort products by Price (low to high) or (high to low). I'm using below code to add Price options (high to low).

<option value="<?= /* @escapeNotVerified */ $_key.'&product_list_dir=asc'; ?>"<?php if($block->isOrderCurrent('price') && $block->getCurrentDirection() == 'asc'): ?> selected="selected"<?php endif; ?>>
                <?php echo $block->escapeHtml(__("Price - Low to High")) ?>
                </option>

                <option value="<?= /* @escapeNotVerified */ $_key.'&product_list_dir=desc'; ?>"<?php if($block->isOrderCurrent('price') && $block->getCurrentDirection() == 'desc'): ?> selected="selected"<?php endif; ?>>
                <?php echo $block->escapeHtml(__("Price - High to Low")) ?>
                </option>

                    <?php else:?>
                    <option value="<?= /* @escapeNotVerified */ $_key ?>"
                <?php if ($block->isOrderCurrent($_key)): ?>
                    selected="selected"
                <?php endif; ?>
                >
                <?= $block->escapeHtml(__($_order)) ?>
            </option>
        <?php endif; ?>

How to fix this issue.Need help...
Category page URL

 https://example.com/boys.html?product_list_order=price%26product_list_dir%3Ddesc


texts: How can i code for get required details from DB using SQL code

texts:
I am new for SQL, I need to get details from db like,

id, sku, name, status
sku,name,category
sku, category

Mentioned above my example requirement. How can i code for get details from database?


texts:
Magento 2 -  How can I remove the white borders from images in product list page?

how can i remove white frame around image in product list page


texts: Add upload field from code at new product form - Magento 2.1

texts:
I'm developing an extension that adds an additional upload field to the product edit form. In Magento 2.0.x I could just simple add an input and the file would be added to the post. Now, with Magento 2.1, the field is not added anymore in the post after saving a product.

Did this change since Magento 2.1? How should I add a custom field to a my custom product tab?


texts: Magento 2: Data validation message input field

texts:
I created an input box in Magento 2 and let the validator check the input value. That works perfect in the example below:

<input id="input-gleich-breite-0"
       class="maximum-length-4 validate-digits-range digits-range-200-1440"
       name="input-width-0"
       type="number"
       data-validate="{required:true, 'validate-number':true}"
       data-msg-required="Please input data between 200 and 1440"
       value="300">

Now I would like to check if the value is in between "200" and "1440".
This should work with the following part of input:

data-msg-validate-number="Please input data between 200 and 1440"

But it doesn't work. It only works with the following and only checks for any data in the input box.

data-msg-required="Please input data between 200 and 1440"

The information are taken from here.
I really appreciate any hint!


texts: How to limit the characters of product name on category page?

texts: i have a magento site and my all products name too long,that why on categories page design  has been broken.I am new in magento,can anybody tell,who  can tell  me,who i will do


texts:
We have dedicated server Magneto 2 and we don't have cPanel or Plesk interface.
We have staging and Live websites.

Please suggest what is the best way of working with Magneto 2.

I feel Our Developers are making changes directly on Live server and whenever something went wrong they just roll back the whole website which is causing more issues.

We need to know the professional way of working with Dedicated Magneto Server.

How developer should work?

Should they work on live site or keep the code in Git???

Please explain


texts: Magento 2.3.4 email not send sometimes when order is placed or when change status

texts: I'm using Magento 2.3.4 on siteground server, when I place an order, the confirmation email sometimes is sent and sometimes not, can someone tell me why?


texts: Magento 2.2: How to redirect to category page?

texts:
I am trying to return a resultRedirect with the category URL but it always redirects me to the current page.

What is the correct way to do it?

    $category = $this->categoryRepository->get($categoryId);
    $resultRedirect = $this->resultRedirectFactory->create();
    return $resultRedirect->setUrl($category->getUr());


texts: How to show few categories with image and description on home page?

texts:
i want to show root categories with image and description on home page content area.
Basically i want show them as slides, each category scrolling with its image and description.

Please suggest


texts:
In which database table can I find the field that contains the "information"
(true or false) if the customer is active or not.

Like in the Backend "customer acc. active".


texts: Overwriting the Magento\Checkout\Controller\Cart\Add::getBackUrl with Plugin

texts:
I've been trying to overwrite the getBackUrl method in the Cart Add controller of the checkout. With a preference I managed without an issue but plugins are a bit more of a challenge.

Here's what I have so far.

di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Controller\Cart\Add">
        <plugin name="[namespace]_[module]_checkout_controller_cart_add_before" type="[Namespace]\[Module]\Controller\Checkout\Cart\Plugin" sortOrder="1" />
    </type>
</config>

Controller/Checkout/Cart/Plugin.php

namespace [Namespace]\[Module]\Controller\Checkout\Cart;

class Plugin
{

    /**
     * @var \Magento\Framework\App\Config\ScopeConfigInterface
     */
    protected $_config;

    /**
     * @var \Magento\Framework\Url
     */
    protected $_url;

    /**
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $config
     * @param \Magento\Framework\Url $url
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $config,
        \Magento\Framework\Url $url
    ) {
        $this->_config = $config;
        $this->_url = $url;
    }

    /**
     * Get resolved back url, rewritten to return checkout URL instead of cart url
     *
     * @param \Magento\Checkout\Controller\Cart\Add $subject
     * @return string
     */
    protected function beforeGetBackUrl(\Magento\Checkout\Controller\Cart\Add $subject)
    {
        return $this->_url->getUrl('some/custom/url');
    }
}

Whatever I try I can't get it to reach the beforeGetBackUrl method.


texts: Magento 2 Product video is not displaying in front end with TypeError: window[this.configSource] is undefined

texts:
I have successfully uploaded/configured Youtube video for a particular product but the video is not showing on the front-end, even though I marked the video as the 'base,' 'small' and 'thumbnail'.

I removed the cache, deployed the static content but the video is still not visible in front end.

I am getting below error in my console:

TypeError: window[this.configSource] is undefined

Any help would be appreciated.


texts:
I have a custom page where the customer will be redirected when he/she orders more than the remaining inventory of the product.

Here's my scenario :

Product 1 remaining inventory is 5 and the customer input a quantity 10 and pressed the Add to Cart button.

If the scenario above happens, i want to redirect to my custom page called http://www.example.com/errorcartpage

Is this possible? If yes, how do i do this?

P.S. Even though magento has default redirect if the scenario above happens, i still want to redirect to a custom page. It's a requirement.

Thanks


texts: How can I get my module to print all sales order PDF files?

texts:
I am creating own module for print order-pdf for the admin section of Magento. This is working fine. I'm able to print individual order pdf as well as multiple order pdf but problem is that When I print complete order pdf with "Print All" then order pdf not printing. Any Suggestion. The Function in below:-

    $this->getMassactionBlock()->addItem('pdfdocs_order', array(
         'label'=> Mage::helper('sales')->__('Print All'),
         'url'  => $this->getUrl('*/sales_order/pdfdocs'),
    ));


texts:
I'm having an issue with pricebox.js/configurable.js and configurable products.  They are used in quickview and on individual product pages.

The first error I get is a console error calling a method on pricebox.js prior to inititialization.  I was able to work through this, and resolve it, leading to more errors

Second error: Once I got that going, when you select configurable products, the initial price is accurate.  When I fill out the select boxes, however, the price goes haywire.  I'll end up with something like $-49.23, or some other ridiculous and or negative number.

Third error: Once a price gets updated through quickview, every single price on that page becomes updated to that price.  So if I select values for product A, the new price for product A will now show up on product B.


texts:
There is a strange problem, about 2 times a day in our .htacess file the RewriteEngine line is changed fron on to off

Options +FollowSymLinks
RewriteEngine off

We have checked everything, there is no hacking, the file permissions are okay, so I think some Magento setting keeps changing this. Problem is that with the RewriteEngine set to off none of the products are accessible anymore.

Any ideas what do I need to check?


texts: We can't add this item to your shopping cart right now on detail page

texts:
If someone want to add a product to the cart from the list view it works fine. But from a product detail page the Error appears:

We can't add this item to your shopping cart right now.


texts: Magento Enterprise: catalog_product_attribute not reindexed on product save

texts:
I'm using Magento ee 1.13.0.2 and discovering the next problem:
I have some of the attributes used in layered navigation - color and size. When I add a new product (simple one) and save it - product successfully appears in catalog, however if I click on product's size/color in layered nav - product is not found. If I go to index management page, I see "Product attributes" has mode "Update on Save" and status "Reindex required". If I reindex manually - everything works fine, product can be found by color/size now.

But this is not something I expect - if there is "Update on Save", index should be updated automatically on product save, without manual reindex, right?

Future tests shows me, that Product attribute index becomes "Reindex Required" always, when I save product even without changes..

I tried to debug reindex on product save, and it appears that queries, which fill catalog_product_index_eav, catalog_product_index_eav_tmp tables are all part of one big transaction, which starts on "product save before" and ends on "product save after". Of course, when I debug queries which are generating data for index_eav tables, they return empty results, because product doesn't even exists in catalog_product_entity table...

So, for now I stuck on this, had any one the same issue?


texts: Magento Credit Card Hijack - how to make sure I'm safe?

texts:
Checked my Magento with Magereport and checked all the points they suggested but it still showing me a "red" Credit Card Hijack even if I remove all the scripts from header/footer.

Did anyone solved this problem ?


texts:
My Catalog Search always processing. What can i do? A tech guy told me that some CL tables are the problem.

Can anyone help me ?

I have done:

reindex

reset index


texts:
i want to get list of category and subcategory (name of category) in magento , i use this API : catalogCategoryInfo (SOAP V2) . i try to get Names of direct child categories but it return id of direct child ! my question is how can i get name of category child ?
 API Link


texts: Page scroll to top after next step with jQuery

texts:
Using jQuery we are appending content in this link.
http://enfolytics.com/NaturallyWhite/booking
If we are selecting bottom service from the list, then on next screen it will automatically focus on the first record or focus to the top of the page.
Can you please help me.

Check Screenshot for better understanding.


texts: Magento2 Checkout Default Topmenu and Basket

texts:
I want to show the default topmenu (incl. basket ) in the onepage checkout.

I think that this part is important:

<block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml" ttl="3600" before="-"/>

But if i add this into my custom checkout_index_index.xml it wont work!
I also see, that the page_layout/checkout.xml has an update handle empty.


texts: Magento 2.3.3 : Uncaught TypeError: Argument 1 passed to Magento\Review\Model\ResourceModel\Review\Summary::appendSummaryFieldsToCollection()

texts:
i have just upgrade to magento 2.3.3 and now i am gettting erorr like

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Review\Model\ResourceModel\Review\Summary::appendSummaryFieldsToCollection() must be an instance of
 Magento\Catalog\Model\ResourceModel\Product\Collection, instance of Ced\CsMarketplace\Model\ResourceModel\Vendor\Collection given, called in
 //vendor/magento/module-review/Observer/CatalogProductListCollectionAppendSummaryFieldsObserver.php on line 57 and defined in
 //vendor/magento/module-review/Model/ResourceModel/Review/Summary.php:87 Stack trace: #0
 //vendor/magento/module-review/Observer/CatalogProductListCollectionAppendSummaryFieldsObserver.php(57):
 Magento\Review\Model\ResourceModel\Review\Summary->appendSummaryFieldsToCollection(Object(Ced\CsMarketplace\Model\ResourceModel\Vendor\Collection), '5', 'product') #1
 //vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): Magento\Review\Observer\CatalogProductListCollectionAppendSummaryFieldsObserver->e in
 //vendor/magento/module-review/Model/ResourceModel/Review/Summary.php on line 87

any one have idea how to resolve this ?


texts: Different translations for same word on different modules won't work

texts:
i created a language pack for my magento2 installation as you can see below;
composer.json;
{
"name": "x/language-tr_tr",
"description": "X Turkish Locale Package / X Shop Türkçe Dil Paketi",
"license": [
    "OSL-3.0"
],
"require": {
    "magento/framework": ">=100.0.0"
},
"type": "magento2-language",
"autoload": {
    "files": [
        "registration.php"
    ]
}
}

language.xml
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
    tr_TR
    <vendor>x</vendor>
    <package>tr_tr</package>
    <sort_order>100</sort_order>
    <use vendor="hidonet" package="tr_tr"/>
</language>

registration.php;
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'x_tr_tr',
    __DIR__
);

and tr_TR.csv;
Processing,Onay Bekliyor,module,Webkul_MpRmaSystem

So, i have two Webkul module (Marketplace, MpRmaSystem) and i want to translate "Processing" word as "Onay Bekliyor" for MpRmaSystem module and "İşleniyor" for Marketplace module. Default translation for "Processing" is "İşleniyor". When i flush cache and reload pages for two modules both of them shows "Onay Bekliyor" for "Processing" word. I just want to show "Onay Bekliyor" translation for MpRmaSystem not Marketplace. How can i prevent this?
Note: I don't want to mess with modules codebase so i am not creating module based translation. I am creating language package parallel to app/ folder for magento2.
Note2: hidonet language pack is not include any translation for "Processing" word.


texts:
I want to include a specific CSS file on a custom page layout I created

I already created a custom page layout (it is a duplicate of two_columns_left) using : App/Code/Core/Mage/Page/etc/config.xml

<layouts>
    [all normal layouts]
    <my_custom_page module="page" translate="label">
        <label>Custom Page</label>
        <template>page/custom-page.phtml</template>
        <layout_handle>page_my_custom_page</layout_handle>
    </my_custom_page>
</layouts>

I created a custom css file to include beside css/custom.css named css/mycustom.css

I added just after

<default>
    ...
</default>

to App/Design/Fronted/[theme]/[design]/Layout/local.xml

<page_my_custom_page>
    <reference name="head">
        <action method="addCss"><stylesheet>css/mycustom.css</stylesheet></action>
    </reference>
</page_my_custom_page>

But the css file wont show up in page generation. Any idea of what couldn't work properly?

Thanks!


texts: Advanced JS bundling: Some dependencies already included under certain JS Bundle are loading separately

texts: I am facing an issue with some dependencies that were already included in some bundle are loading separately as seen in the browser console. Could you please share yours insights into this? Please refer the screenshots below. For example, common.js included under Bundle/default is loading separately as seen in the second screenshot.


texts: How to get option value from option label of a specific attribute

texts: I'm looking for having attribute option value from its label Indeed I have a list of labels ans I want to generate their value s of each one.


texts: How to get Group expired date by product SKU?

texts:
I want to get Group expired date by child product SKU which belong to that group.

My code is,

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $this->_productRepository->get($productSku);

$parentProductId = $objectManager->create('Magento\GroupedProduct\Model\Product\Type\Grouped')
        ->getParentIdsByChild($product->getId());

$parentSku = ???

When I var_dump $parentProductId, it return empty array. Any help?


texts:
The timezone dropdown is empty and I cannot get pass locale selection in magento 1.8 install wizard.

I copied all the files to hosting ... so whats the idea?

btw ... this solution http://www.magentocommerce.com/boards/viewthread/288663/ does not work.


texts: catalog rule not applied at product page but working at checkout page

texts: Yesterday I added a catalog price rule of 20 % discount for one of my categories but the catalog rule is only working at checkout, the discounted price is not get reflected on the product list page, I am running Magento commerce on my mobile, I have designed an android app to run this Magento commerce from one of the development company but the company is saying catalog rules are only applied at checkout times


texts: Magento log is not writing in log folder

texts: Log files are not writing in the log folder but previously  they are writing in the folder. Any idea about this?.


texts:
We have a magento 1.9 store, and there is a constant problem with the cache follder growing, over 50gb in 2 weeks.

The mage--9 folder seems to hold most of that, and there are few milions file with namkes and content like this:

mage---internal-metadatas---590_FFFFD3ECB5F39120351F01E2611DD7B3

a:4:{
s:4:"hash";
i:159752789;s:5:"mtime";
i:1450156222;s:6:"expire";
i:1450159822;s:4:"tags";
a:11:{
    i:0;s:14:"590_BLOCK_HTML";
    i:1;s:27:"590_CACHE_BLOCKHTML_OBJECTS";
    i:2;s:35:"590_MAGE_CATALOG_BLOCK_PRODUCT_LIST";
    i:3;s:22:"590_CATALOG_CATEGORY_3";
    i:4;s:26:"590_CATALOG_PRODUCT_105545";
    i:5;s:22:"590_CATALOG_CATEGORY_3";
    i:6;s:22:"590_CATALOG_CATEGORY_4";
    i:7;s:22:"590_CATALOG_PRODUCT_73";
    i:8;s:22:"590_CATALOG_CATEGORY_2";
    i:9;s:22:"590_CATALOG_CATEGORY_3";
    i:10;s:8:"590_MAGE";
    }
}

We are using NytroGento cache,
And admin Cache refresh is not responding ..
And our Products have a crazy structure with lots of option.

Any pointers on what the problem may be ?


texts: Setting Price Step for Custom Price Attribute in Layered Navigation

texts:
I have created a product attribute of type "Price". I am using this attribute as a filter in the Layered Navigation.

My problem is that this custom price attribute does not follow the settings for the default price attribute under System > Configuration > Catalog > Catalog > Layered Navigation.

I have set the Price Navigation Step Calculation field to "Automatic (equalize product counts)". I need this same setting applied to my custom price attribute (id=product_price).

How can I set my custom price attribute to display price tiers as "Automatic (equalize product counts)" instead of "Automatic (equalize price ranges)" which seems to be the default?


texts: Discount from Specific Shipping Method based on coupon code in Magento

texts:
I need in admin section to apply coupon only on particular shipping method not discount from other shipping method. I should be able to select shipping method in admin which I want to allow for discount.

In frontend whenever customer apply that coupon, the amount should not deducted from the subtotal/ grand total, Only the particular shipping method(Which we had allowed in admin section) should be pre-selected and shown with discount applied.

Please find the sample screenshot in attachment. This is what I want to achieve.


texts: How to set Manage Stock to "NO" in Magento 2.1 backend for all Store Views?

texts:
How can I set Manage Stock to "NO" in Magento 2.1 as a Config Setting (system value) from the backend?

By Config Setting I mean that the "NO" value should be the system value (preset) when creating a new prodcut in any Store View.


texts: How to see the customer tables in database in magento1?

texts: How to see the customer tables in magento1


texts: In Magento 2 I got a message to check exception error logs. How can I check that?


texts: SUPEE6788 Patch installation magento, Showing error Could not open input file: fixSUPEE6788.php

texts:
I have installed SUPEE6788 Patch, it affected many modules and files and to fix this I have followed https://github.com/rhoerr/supee-6788-toolbox

But now I am running command php -f fixSUPEE6788.php -- fixWhitelists

In terminal it is showing me this error:

  Could not open input file: fixSUPEE6788.php

Can anyone please help me out.


texts:
I'm trying to display Customer initials instead of full names in the Customer Grid.
ie.
Instead of "Mr John Middle Smith" I would like "Mr J M Smith"

Can anyone point me in the right direction to change this:

    $this->addColumn('firstname', array(
        'header'    => Mage::helper('customer')->__('First Name'),
        'index'     => 'firstname',
    ));

To just get the first character of firstname

Thanks :-)


texts:
I am trying to hide prices when a specific customer attribute is set to "true".
Because of FP-Caching, this has been very difficult to accomplish.

I can't update the FinalPriceBox directly with plugin, as this data gets cached and switching the value on / off on customer entity doesn't update on frontend with caching enabled. Attempting to disable cache for that block alone actually disables cache for the entire page which is no good.

I have also attempted to create my own component, that can hide or display the block and provide the customer attribute via plugin for Magento\Customer\CustomerData\Customer => Magento_Customer/js/view/customer-data.
However this gives complications on first page loaded after login (data is not upto-date). Also this saves the field into the cookie storage, which would mean that variable can be controlled on client-side cookie.

Any suggestions of an approach to display the price when the customer attribute is "false" and display a custom block when customer attribute is "true"? Must maintain all cacheable blocks.

Maybe adding new section-data that will load specific to my module?


texts:
I am using onepge checkout in Magento1, now I want to add class in subtotal section like here is class last I want add new class how I do that wihout using jquery

        Grand Total


texts: Magento 2 Order print showing href links with content!

texts:
I have social links in footer in the website, and configured url in admin configuration for social icons.

But when I am printing order PDF from customer account order view page then all links on the pdf are showing seperated with icons.

Links which are in anchor href must not be shown here.

Check Screenshot: links are visible in pdf


texts: How to get value from custom drop down field of system config in magento 2

texts:
I need the value of selected value from system config file.

Below is my code example.

system.xml file

<field id="test" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
     <label>Select Product Tab</label>
     <source_model>Vendor\Modulename\Model\Config\Source\Products</source_model>
</field>

Model file

namespace Vendor\Modulename\Model\Config\Source;

use Magento\Framework\Option\ArrayInterface;

class Products implements ArrayInterface
{

    /*
     * Option getter
     * @return array
     */
    public function toOptionArray()
    {
        $arr = $this->toArray();
        $ret = [];
        foreach ($arr as $key => $value) {
            $ret[] = [
                'value' => $key,
                'label' => $value
            ];
        }
        return $ret;
    }

    /*
     * Get options in "key-value" format
     * @return array
     */
    public function toArray()
    {
        $valList = [
            '1' => 'A',
            '2' => 'B',
            '3' => 'C',
            '4' => 'D'

        ];
        return $valList;
    }
}

I need selected value in block or template file


texts: I need to add telephone field on customer registration page in magento 2

texts: I need to enable telephone field on Registration page in magento 2.Any guide how to do this.


texts: I was wondering if there are any good guides for migrating a magento 1 theme to 2 as the magento documentation doesn't really give me an idea on how to do it. I am a back end developer!!


texts: Error while assigning product to category?

texts:
I am trying to assign category to product through a simple script and it's throwing an error i have tried doing through admin panel and it works there but as i have to do this for thousands of products i can't do it through the admin panel.

Here is myscript

<?php

$product = Mage::getModel('catalog/product')->load(55181);
$product->setCategoryIds(array(437));
$product->save();

?>

Error :

PHP Fatal error:  Uncaught exception 'Mage_Eav_Model_Entity_Attribute_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '55181-0-1-100.0000-0' for key 'E8AB433B9ACB00343ABB312AD2FAB087'' in /path/public/app/code/core/Mage/Core/Model/Config.php:1348


texts: module to install attribute using setup resource

texts:
I tried to create a shopping module with help, when I install the module it should add a custom attribute
but for some reason it is not working

I have this structure:

config.xml is simple and just telling where to find the resource and the module name:

 <?xml version="1.0"?>
<config>
  <modules>
    <Cart_Shopping>
      <version>1.0.0</version>
      <title> Product Message</title>
    </Cart_Shopping>
  </modules>
  <global>
    <resources>
      <shop_setup>
        <setup>
          <module>Cart_Shopping</module>
          <class>Mage_Eav_Model_Entity_Setup</class>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </shop_setup>
      <shop_write>
        <connection>
          <use>core_write</use>
        </connection>
      </shop_write>
    </resources>
  </global>
  <adminhtml>
    <fieldsets>
      <cart_message>
        <create>1</create>
        <update>1</update>
      </cart_message>
    </fieldsets>
  </adminhtml>
</config>

here is installer,the mysql4-install-1.0.0

$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
Mage::log("negin", null, 'mylogfile.log');
$installer->startSetup();
$installer->addAttribute('catalog_product', 'cart_message', array(
  'type'              => 'varchar',
  'backend'           => '',
  'frontend'          => '',
  'label'             => 'Message in Cart',
  'input'             => 'select',
  'class'             => '',
  'source'            => 'catalog/product_attribute_source_layout',
  'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
  'visible'           => true,
  'required'          => false,
  'user_defined'      => false,
  'default'           => '',
  'searchable'        => true,
  'filterable'        => false,
  'comparable'        => false,
  'visible_on_front'  => true,
  'unique'            => false,
  'group'             => 'General'
));
$installer->endSetup();

also app/etc/modules file which is reading the codepool of local:

  <config>
    <modules>
      <Cart_Shopping>
        <active>true</active>
        <codePool>local</codePool>
        <version>1.0.0</version>
      </Cart_Shopping>
    </modules>
  </config>

would you please tell me what is wrong in my configuration?


texts: Magento 2.3.2 Address How to Remove City Field

texts:
I am using the Magento 2.3.2.

I want to remove "City" field into the checkout.

I have added the following code into my theme checkout_index_index.xml file:

<item name="city" xsi:type="array">
  <item name="visible" xsi:type="boolean">false</item>
</item>

The City field is not displaying But when I am Placing the order then following error occured:

  Please check the shipping address information. "city" is required. Enter and try again.

Can you please tell me how to remove the city field into the checkout without error when placing an order.

Thanks


texts: Change first product image that is displayed on product page - Magento 2.3.5

texts:
How can we change the product image that is displayed first when the productpage is loaded?
At the moment this is the first image in line, but we want to change this to be the "base" image.
How can we achieve this?


texts: Magento 2 Installation - 503 (Service Unavailable) Error

texts:
Tried installing Magento 2 using setup wizard. All the checks were correct and installation was completed till 90%. After that it did not show any progress for many hours.
When I run the http://localhost/magento_2, it takes forever to load and prints 503 error.

Service Unavailable_img

As mentioned here I tried debugging as Apache 2.4 changes the way certain directives related to .htaccess work.

Suggested solution on website

As a user with root privileges, enter the following commands:

a2enmod access_compat
service <name> restart

How do I debug this issue on my local WAMP server and succesfully install Magento 2 with sample data ?


texts: How to retrieve a limited number of products from the catalog?

texts:
I am trying to retrieve a limited number (three) of products from the catalog. Here's my (not working) code:

$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect('*');
$products->getSelect()->order('rand()');
$products->getSelect()->limit(3);

foreach ($products as $product) {
    // Do stuff with $product
}

The problem is I am getting sometimes only one product and sometimes no products. Although I have more than three products in the catalog.

Edit:

Here is the query computed by $products->getSelect();:

SELECT `e`.* FROM `miiny_catalog_product_entity` AS `e` ORDER BY rand() ASC LIMIT 3

I'm using Magento 1.9.2.4.

Thanks in advance.

Louis.


texts: How to add custom text after price in list page Magento 2

texts:
I need price like $20.23/each. But I tried in  $html in /vendor/magento/module-catalog/Pricing/Render/FinalPriceBox.php but its not working. Can you please anyone help me.

protected function wrapResult($html)
{
    $html=str_replace("", "/each", $html);
    return '
getData('css_classes') . '" ' .
        'data-role="priceBox" ' .
        'data-product-id="' . $this->getSaleableItem()->getId() . '"' .
        '>' . $html . '
';
}


texts: Magento 2: How to show shipping amount without refreshing my cart page?

texts:
I try to bring the amount of the shipment from the backend without javascript. But when the cart page is displayed for the first time, the shipping amount is displayed as follows:

but when I refresh the page, then the amount of the shipment is shown as it should be:

This is my backend code, to get the shipping amount:

<?php
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');
$shipping_amount=$cart->getQuote()->getShippingAddress()->getShippingAmount();?>

Shipping (<?php echo $shipping_amountc; ?>)
<?php echo number_format($shipping_amount,2);?>

Is there any way to bring the shipping amount without refreshing the page? please who can help me, I appreciate it!


texts: main.CRITICAL: SQLSTATE[HY000] [2002] Connection refused magento2

texts:
Getting this error in live site kindly help me

[2020-06-05 05:18:27] main.CRITICAL: SQLSTATE[HY000] [2002] Connection refused {"report_id":"e873ea2faa3854c65aa211c09b211758e5c754902980db29df10cf09aafa8ec5","exception":"[object] (Zend_Db_Adapter_Exception(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /var/www/html/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144, PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /var/www/html/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"} []

getting this error so many times in log kindly help me how to fix this
already tried env.php fix localhost to 127.0.0.1
but still not able to fix


texts: Map attribute set based on Default attribute set programatically in magento 2

texts:
I have below script for creating attribute set, sets are created, but none of the attributes are assigned to based on the Default.

How do i map the attributes sets to have the default attributes?

app\code\Custom\AttributeSet\Setup\UpgradeData.php

$categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
    if(version_compare($context->getVersion(), '1.1', '<'))
    {
        $attributeSet = $this->attributeSetFactory->create();
        $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
        $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
        $datas = [
            [
                'attribute_set_name' => 'Test Set10',
                'entity_type_id' => $entityTypeId,
                'sort_order' => 200,
            ],
            [
                'attribute_set_name' => 'Test Set20',
                'entity_type_id' => $entityTypeId,
                'sort_order' => 200,
            ],
            [
                'attribute_set_name' => 'Test Set30',
                'entity_type_id' => $entityTypeId,
                'sort_order' => 200,
            ]
        ];

        foreach ($datas as $data) {
            $attributeSet = $this->attributeSetFactory->create();
            $attributeSet->setData($data);
            $attributeSet->validate();
            $attributeSet->initFromSkeleton($attributeSetId);
            $attributeSet->save();
        }
    }
}


texts: How display a carousel only on the first page of the listing of product in each category

texts:
Where you are in a category you have the list of your products.
I display actually a carousel a the position of a product.
But my problem i don't know how display only this carousel on the first and not on all the pages ?


texts: My Magento 2.1.5 is missing PayPal All-In-One Payment Solutions

texts: Not sure why, but I dont have PayPal All-In-One Payment Solutions. All I have as options for paypal are PayPal Express Checkout & Braintree. Not sure what to do or how to get it. Any help would be great


texts: Get a json response and map the data, help?

texts:
I have a data response in json format, I request from an external api rest and I want to proceed to map magento with those data that come to me and I have no idea how to do it respecting the good practices of magento.
for example, get a price list of products and send them to where ......?
If you have an example that is very useful, I would appreciate it, the magento documentation does not explain very well how to handle third party data and proceed to map the obtained information


texts: How can I replicate "Send Tracking Information" behaviour in Magento using PHP

texts:
I have a cronJob written in PHP which reads Tracking numbers from a CSV and updates in Magento.

My code looks like this

  if ($order->getShipmentsCollection()->getData()) {
            foreach ($order->getShipmentsCollection() as $shipment) {
                $shipmentid = $shipment->getId();
                $shipment = Mage::getModel('sales/order_shipment')->load($shipmentid);
                $trackdata = array();
                $trackdata['carrier_code'] = $data[22];  //get CARRIER_NAME from csv
                $trackdata['title'] = $data[22];    //get title from csv
                $trackdata['number'] = $data[20];       //get CONSIGNMENT_NO from csv

                $track = Mage::getModel('sales/order_shipment_track')->addData($trackdata);
                $shipment->addTrack($track);
                $transactionSave = Mage::getModel('core/resource_transaction')
                        ->addObject($shipment)
                        ->addObject($shipment->getOrder())
                        ->save();

                $shipment->sendEmail($email, ($includeComment ? $comment : ''));
            }
        } else {

            $convertor = Mage::getModel('sales/convert_order');
            $shipment = $convertor->toShipment($order);

            foreach ($order->getAllItems() as $orderItem) {
                if (!$orderItem->getQtyToShip()) {
                    continue;
                }
                if ($orderItem->getIsVirtual()) {
                    continue;
                }
                $item = $convertor->itemToShipmentItem($orderItem);
                $qty = $orderItem->getQtyToShip();
                $item->setQty($qty);
                $shipment->addItem($item);
            }

            $trackdata = array();
            $trackdata['carrier_code'] = $data[22];  //get carrier_code from csv
            $trackdata['title'] = $data[22];    //get title from csv
            $trackdata['number'] = $data[20];       //get track number from csv
            $track = Mage::getModel('sales/order_shipment_track')->addData($trackdata);
            $shipment->addTrack($track);

            $shipment->register();
            $shipment->addComment($comment, $email && $includeComment);
            $shipment->setEmailSent(true);
            $shipment->getOrder()->setIsInProcess(true);

            $transactionSave = Mage::getModel('core/resource_transaction')
                    ->addObject($shipment)
                    ->addObject($shipment->getOrder())
                    ->save();

            $shipment->sendEmail($email, ($includeComment ? $comment : ''));
        }

It works well but only thing is that does not do what "Send Tracking Information" button, this button

I want to replicate its behaviour.

Actually when "Send Tracking Information" button is clicked email is sent via PackPin API to customer.

But with my code it doesn't send.


texts:
For every product in my magento i have custom attributes like - food_taste, food_brand and many more. I use them for filtering my products in category view. But now i want when clients open the product to see attributes.

Example:
Brand: Royal Canin
Taste: Chicken
......
I try with some codes that i found here, but...

$productId = 52;
$product = Mage::getModel('catalog/product')->load($productId);
$attributes = $product->getAttributes();

foreach ($attributes as $attribute) {
    $attributeCode = $attribute->getAttributeCode();
    $label = $attribute->getStoreLabel($product);
    $value = $attribute->getFrontend()->getValue($product);
    echo $attributeCode . '-' . $label . '-' . $value; echo "<br />";
}

Can you help me to do that.

Thank you


texts: How can I redirect user to log in page for checkout instead of using the login modal?

texts:
Currently, we have guest checkout disabled on our store. When someone tries to go to checkout, a modal appears asking them to log in or create an account.

Is there a way to disable this in Magento 2, or do we need to do the equivalent of this and use a custom module?


texts: Magento2 - Livechat Node.js and Socket.io

texts: I need to develop new live chat application using socket.io and Node.js for reference http://socket.io/get-started/chat/. Magneto2 can support Node.js and Socket.io.


texts: Magento 1.9 - Catalog URL Rewrites - Index product and categories URL rewrites

texts:
Invalid backend model specified: enterprise_catalog/product_attribute_backend_urlkey

Please see the image below for error. I am not able to index this field.


texts:
In checkout customer set shipping adress http://screenshots.collabstar.com/ao/252.png
But on next step in billing adress and shipping adress data is empty like on screen
http://screenshots.collabstar.com/ao/251.png
Who has the same bropblem? I use magento2 v 2.1.7


texts: Magento 2 : I Can get Collection from database but cannot save data in database

texts:
I have a custom table in which I want to save data.
I tried below different methods to save data in table.But cannot get success.
Please check below methods :

Method 1 :

$model = $this->_objectManager->create('Namesapce\Modulename\Model\Test\Product');
$model->setRowId(1);
$model->setProductId(2048);
$model->save();

Method 2 :

$model = $this->_objectManager->create('Namesapce\Modulename\Model\Test\Product');
$data = ['row_id' => 1, 'product_id' => '2048'] ;
$model->setData($data);
$model->save();

For testing purpose I have manually insert data in table and then try to getcollection.

Strange thing is I can sucessfully get collection of data from table.but can not save. I also put above code in try catch but it always going in try. Not in catch.

Please take me out from this issue.
Thank you.


texts: Adding custom parameters to Facebook pixel within extension

texts:
We're using the Facebook Ads Extension, which is great for feed creation but I can't see a way to edit the pixel so I can add extra parameters. I actually want to add;

fbq('track', 'PageView', {
referrer: document.referrer
});

instead of just;

fbq('track', 'PageView');

In GTM I could add the base code again with this included but that would fire the pixel twice. Is there any way to customise the pixel in the Facebook Ads Extension?

Thanks

Richard


texts: I am running commands setup:di:compile and cache: clean it's running for while, but after sometime it got killed in magento2.3.2. Please let me know the exact issue for this.


texts: how to change topmenu and fill with my own categories and sub categories?

texts: I wanted to remove all menu items from top menu and fill in with my categories and subcategories and make it point to different pages that I create. should I edit topmenu.phtml file?


texts:
How to add extra price on configurable product and it's child (Simple Product) magento 2x

like this : ($1.95 for configurable and $1.25 for it's child)

I want to add this price on frontend. After adding extra price, checkout and cart functionality use this new price i.e newPrice = productPrice + extraPrice;


texts: Control.Slider is not a constructor New Extension Problem 1.9.2.4

texts:
I have just paid $150 for an extension from MageStore (Reward Points Plus) and it is not working.

The error I am getting is:

prototype.js:828 Uncaught TypeError: Control.Slider is not a constructor

In the extension JS the code is:

    var RewardPointsSlider = Class.create();
RewardPointsSlider.prototype = {
    initialize: function (pointEl, trackEl, handleEl, zoomOutEl, zoomInEl, pointLbl) {
        this.pointEl = $(pointEl);
        this.trackEl = $(trackEl);
        this.handleEl = $(handleEl);
        this.pointLbl = $(pointLbl);

        this.minPoints = 0;
        this.maxPoints = 1;
        this.pointStep = 1;

        this.slider = new Control.Slider(this.handleEl, this.trackEl, {
            axis: 'horizontal',
            range: $R(this.minPoints, this.maxPoints),
            values: this.availableValue(),
            onSlide: this.changePoint.bind(this),
            onChange: this.changePoint.bind(this)
        });
        this.changePointCallback = function (v) {
        };

        Event.observe($(zoomOutEl), 'click', this.zoomOut.bind(this));
        Event.observe($(zoomInEl), 'click', this.zoomIn.bind(this));
    },
    availableValue: function () {
        var values = [];
        for (var i = this.minPoints; i <= this.maxPoints; i += this.pointStep) {
            values.push(i);
        }
        return values;
    },
    applyOptions: function (options) {
        this.minPoints = options.minPoints || this.minPoints;
        this.maxPoints = options.maxPoints || this.maxPoints;
        this.pointStep = options.pointStep || this.pointStep;

        this.slider.range = $R(this.minPoints, this.maxPoints);
        this.slider.allowedValues = this.availableValue();

        this.manualChange(this.slider.value);
    },
    changePoint: function (points) {
        this.pointEl.value = points;
        if (this.pointLbl) {
            this.pointLbl.innerHTML = points;
        }
        if (typeof this.changePointCallback == 'function') {
            this.changePointCallback(points);
        }
    },
    zoomOut: function () {
        var curVal = this.slider.value - this.pointStep;
        if (curVal >= this.minPoints) {
            this.slider.value = curVal;
            this.slider.setValue(curVal);
            this.changePoint(curVal);
        }
    },
    zoomIn: function () {
        var curVal = this.slider.value + this.pointStep;
        if (curVal <= this.maxPoints) {
            this.slider.value = curVal;
            this.slider.setValue(curVal);
            this.changePoint(curVal);
        }
    },
    manualChange: function (points) {
        points = this.slider.getNearestValue(parseInt(points));
        this.slider.value = points;
        this.slider.setValue(points);
        this.changePoint(points);
    },
    changeUseMaxpoint: function (event) {
        var checkEl = event.element();
        if (checkEl.checked) {
            this.manualChange(this.maxPoints);
        } else {
            this.manualChange(0);
        }
    },
    changeUseMaxpointEvent: function (checkEl) {
        Event.observe($(checkEl), 'click', this.changeUseMaxpoint.bind(this));
    },
    manualChangePoint: function (event) {
        var changeEl = event.element();
        this.manualChange(changeEl.value);
    },
    manualChangePointEvent: function (changeEl) {
        Event.observe($(changeEl), 'change', this.manualChangePoint.bind(this));
    }
}

This controls the slider to add discount to the order.

I have contacted Magestore who are not willing to help me until next week as they are on holiday.


texts: Magento 1.9 - Zero SubTotal Checkout < 0

texts:
Is it possible to change the Zero SubTotal Checkout function to allow anything less than or equal to zero?

So a negative grand total would not require a payment.


texts: Magento 2 Get last and first item from model collections

texts:
I want to retrieve the last and first item from model collection in magento 2, in magento 1.9 i can simply retrieve it like this :

$lastItem = $collections->getLastItem();
$firstItem = $collections->getFirstItem();

is there a way i can do the same in magento 2, without using foreach loop like this:

$collections = $this->_objectManager->create('Namespace\Module\Model\Test')->getCollection();
$i=0;
foreach($collections as $collection){
  if($i == 0){
    $firstItem = $collection;
    $i++;
  } else{
    $lastItem = $collection;
  }
}


texts: Why on checkout page shipping and billing address are reset after page refresh?

texts:
We have the following situation in Magento:

Guest customer is about place order.
The customer filled his billing and shipping addresses on checkout page.
The customer reached one of the following checkout steps (shipping methods, payment methods, order review).
The customer decides to edit his cart and goes back to cart page
The customer reaches the checkout page again and he has to fill shipping and billing address.

My question is what is the non programming reason to always start with fresh addresses on checkout page even when a customer filled them already in current checkout session?

It looks that Magento Core Team intentionally wants this effect. But why? Is there an edge case that may cause problems for the customers?


texts: How to know which patch you have installed a local magento?

texts:
I have a magento installed locally and want to know which patch is installed, so I can install this same patch on another magento site but I don't know how to find out.

The person who installed it, put a file in each file folder and left no documentation.
Is there some kind of plugin or any option to learn what patch is installed?

Thank you


texts: difference between frontend quote and admin quote

texts:
In magento when any customer adds product to cart or when admin adds a product to any customer's cart from backend then the values are inserted in sales_flat_quote table. Does anybody have idea that how we can differentiate between frontend and backend's data by looking into the table's data (if both are booked with same customer id) ?
Thanks


texts: Is multivendor a hard thing to do in magento 2?

texts:
My client wants to build a multivendor shop based on magento 2. There's no shortage of extensions that does that, perhaps the most famous is created by webkul, my client was ready to pay webkul a huge sum of money in order to buy many extensions from them.

I wonder if it's a hard task to do by coding because I need the rest api, the extensions don't have a rest API, and at some point in the future, the plan is to create a mobile app.

So if doing multivendor isn't a big deal in magento 2, at least I'd be able to do it the way I want it to be. The less extensions the better.


texts:
I added a discount code and noticed all products were applied by the discount, so removed and deleted.

However all  products are still discounted. No codes are active, all deleted. HELP !!!!


texts:
I am creating a custom module. I have a form which have some fields.
Here are fields.

All Fields are working Fine.. But 08,09 Field show 0 Value in Admin Form.

Any Idea to solve this one.?