texts: How to get product custom attribute in Magento 1 SOAP api?

texts:
I have created one product attribute of dropdown type from backend with some name "ABC" which has two option "A" and "B", so when I am calling product API as :
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:catalogProductInfo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sessionId xsi:type="xsd:string">f89f61764359e20a0f207d569b104f73</sessionId>
         <productId xsi:type="xsd:string">1234567</productId>
         <storeView xsi:type="xsd:string">code</storeView>
         <attributes xsi:type="urn:catalogProductRequestAttributes">
            <additional_attributes xsi:type="urn:ArrayOfString" soapenc:arrayType="xsd:string[]">
                <attribute>abc</attribute>
            </additional_attributes>
         </attributes>
      </urn:catalogProductInfo>
   </soapenv:Body>
</soapenv:Envelope>

then I am getting addition attribute like this :
<additional_attributes SOAP-ENC:arrayType="ns1:associativeEntity[1]" xsi:type="ns1:associativeArray">
               <item xsi:type="ns1:associativeEntity">
                  <key xsi:type="xsd:string">abc</key>
                  <value xsi:type="xsd:string">44966</value>
               </item>
            </additional_attributes>

I checked that it is getting option value, but I want label as "A", what is wrong with my API xml ?
Please help or refer any documentation as Magento has officially removed the documentation !!
Thanks in advance.


texts: Magento 2.3 disable or secure API access

texts:
In the developer docs I've found the option to unrestrict API access. Is there an option to restrict access to the API for everything i.e. nothing is anonymous? Or is there a way to disable the magento API?

Maybe I misunderstand but seems like bots can spam your API endpoint to retrieve a lot of information.

https://devdocs.magento.com/guides/v2.3/rest/anonymous-api-security.html

Update

Am I correct in saying that Magento 1 doesn't allow anonymous access?


texts: Magento - Cart Price Rules Quantity Issue

texts:
Ok so I have a really puzzling problem which I can't seem to get past, I think my logic is flawed.

We're providing combination deals such as:

3 items = 2% Off
4 items = 4% Off
5 items = 6% Off
6 items = 8% Off

Now I've got this working fine up to now but I have one main problem which is stopping me from continuing with the project. The problem is for example:

A customer adds 4 separate items to the basket and they get the 4% discount. But on the last minute they decide change the quantity of one of the 4 items to 2. Now when they change the quantity of one of the items to 2, the discount reverts back to 2% but for the cost of the 5 items.

When adding 3 items they get 2% discount and if they change the quantity it keeps the discount the exact same, so the first rule works fine, but anything above the 3 items combo rule is messes up.

Any help at all would be amazing help for me.

Thanks a lot guys.

Note: Try it to see exactly my situation: http://bathroomcouture.co.uk/testserver


texts:
all was good earlier but suddenly all the blocks from front end disappeared, blocks are active in backend but not visible on front end.

https://www.i-ranu.com


texts:
I am trying to instantiate the class Varien_File_Csv_Multy which is located in

  lib/Varien/File/CsvMulty.php

$csv= new Varien_File_Csv_Multy();
echo get_class($csv);

and

$csv= new Varien_File_CsvMulty();
 echo get_class($csv);

Its throwing error  Fatal error: Class 'Varien_File_Csv_Multy' not found

I want to know how to add I access the methods of the class.Is this class used in Magento core code anywhere.


texts:
I'm Using a mega menu extension for magento. I need to display a thumbnail before the category link in top navigation menu.
So far, I've tried adding
getThumbnail()  ?>" /> to my menu view file (top.phtml), but It didn't work out.

My menu view file:

<?php
$menuHelper = $this->helper('olegnaxmegamenu');
if ( $menuHelper->getCfg('general/status') ) :

    $_menu = $this->getHtml('level-top', 'megamenu-dropdown');
    ?>
    <?php if ($_menu): ?>
    <div class="nav-container olegnaxmegamenu icons-<?php echo Mage::helper('athlete')->getAppearanceCfg('navigation/sub_nav_icons'); ?>">

<?php echo $this->__('Navigation'); ?>

            <?php if ($menuHelper->getCfg('additional/home')) : ?>

                    <a href="<?php echo $this->getBaseUrl(); ?>"><?php echo $this->__('Home'); ?>

            <?php endif; ?>
            <?php echo $_menu; ?>
            <?php
            $customBlock = $menuHelper->getCfg('additional/custom_block_id');
            if ( !empty($customBlock) ) {
                $customBlock = Mage::getModel('cms/block')
                    ->setStoreId( Mage::app()->getStore()->getId() )
                    ->load($customBlock);
                if($customBlock->getIsActive()) {
                    echo '

                        '.$customBlock->getTitle().'

'.$menuHelper->processCmsBlock($customBlock->getContent()).'

';
                }
            }

            $additionalBlock = $menuHelper->getCfg('additional/additional_block_id');
            if ( !empty($additionalBlock) ) {
                $additionalBlock = Mage::getModel('cms/block')
                    ->setStoreId( Mage::app()->getStore()->getId() )
                    ->load($additionalBlock);
                if($additionalBlock->getIsActive()) {
                    echo $menuHelper->processCmsBlock($additionalBlock->getContent());
                }
            }

            ?>

<?php endif ?>
<?php endif; //if ( $menuHelper->getCfg('general/status') ) : ?>


texts: Magento 2 individual add to cart buttons on group children

texts:
I am reworking how the grouped products are shown in M2.  I have the following which shows the child products in a grid with pictures just like in a category.  I am stuck as to how I would include an add to cart button on each item.  Can anyone help?  Thanks in advance.

JJ

Individual Products &darr;

        <?php if ($_hasAssociatedProducts): ?>
        <?php foreach ($_associatedProducts as $_item): ?>

              <a href="<?php /* @escapeNotVerified */ echo $_item->getProductUrl() ?>">
                <?php
                  $_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
                  $productImage = $_imagehelper->init($_item, 'product_base_image')
                  ->constrainOnly(FALSE)
                  ->keepAspectRatio(TRUE)
                  ->keepFrame(FALSE)->resize(240)->getUrl();?>
                  <img src="<?php echo $productImage;?>" width="300" height="300" alt="<?php echo $block->escapeHtml($_item->getItemName()) ?>">
                  <?php echo $block->escapeHtml($_item->getItemCollection()) ?>

                  <?php echo $block->escapeHtml($_item->getItemName()) ?>

               <?php if ($block->getCanShowProductPrice($_product)): ?>
                  <?php if ($block->getCanShowProductPrice($_item)): ?>
                      <?php /* @escapeNotVerified */ echo $block->getProductPrice($_item) ?>
                  <?php endif; ?>
               <?php endif; ?>
            <?php if ($_product->isSaleable()): ?>
            <?php if ($_item->isSaleable()) : ?>

            <?php else: ?>
              <div class="stock unavailable" title="<?php /* @escapeNotVerified */ echo __('Availability') ?>">
                  <?php /* @escapeNotVerified */ echo __('Out of stock') ?>

            <?php endif; ?>
            <?php endif; ?>
            <?php if ($block->getCanShowProductPrice($_product)
            && $block->getCanShowProductPrice($_item)
            && trim($block->getProductPriceHtml(
              $_item,
              \Magento\Catalog\Pricing\Price\TierPrice::PRICE_CODE
            ))): ?>
                  <?php echo $block->getProductPriceHtml(
                      $_item,
                      \Magento\Catalog\Pricing\Price\TierPrice::PRICE_CODE
                  ) ?>
            <?php endif; ?>

        <?php endforeach; ?>

         <?php else: ?>
                            <?php /* @escapeNotVerified */ echo __('No options of this product are available.') ?>
        <?php endif; ?>


texts: Magento 2: How to Get Subcategory Image in Category Page?

texts:
I want to display subcategory in category page with the image.
I've to put below code get only subcategory name not getting the image.

How to get subcategory image in category page?

if($this->getLayer()->getCurrentCategory())

            $subcategories=$this->getLayer()->getCurrentCategory()->getCategories($this->getLayer()->getCurrentCategory()->getId());

            if($subcategories->count()>0){

                foreach($subcategories as $subcategory){

                      <a href="<?php echo $subcategory->getRequest_path(); ?>"><?php echo $subcategory->getName() ?>

                }
            }else{}

endif;


texts: How to show catalog attribute in cross-sell in shopping cart which overridden by an Extension module

texts:
Magento 2.3

I have an extension's file that overrides my theme's file, which in turn overrides Magento core file.

the extension's file

app/code/VendorName/ModuleName/view/frontend/templates/product/list/items.phtml

My theme's file

app/design/frontend/MyThemeName/modulename/Magento_Catalog/templates/product/list/items.phtml

Following advice from

Magento 2 - Display Attribute on Cart Page

does not work, I added the file catalog_attributes.xml in the extension module folder and modify the extension's items.phtml, but the page returns error

PHP Fatal error:
Uncaught Error: Call to a member function getData() on null in
/home/myusername/public_html/app/code/VendorName/ModuleName/view/frontend/templates/product/list/items.phtml


texts:
I try change text-transform:none; to text-transform:uppercase; in horisontal menu theme LUMA.
I try add to _theme.less:

@navigation-level0-item__text-decoration: uppercase;
@navigation-desktop-level0-item__text-decoration: uppercase;

But no changes.


texts: How edit the error page to show custom text instead of "There has been an error processing your request"

texts: I would like to change the look of error page and put different text. What is the path to related file?


texts: hide dropdown and show textbox on Cart page while selecting 10+ option from dropdown

texts:
There is a drop-down value from 1 to 10+ on Cart page. Whenever I select 1 to 9 option from drop-down, Cart is updated onchange event.

When I select 10+ from the drop-down, drop-down should be hidden.and Textbox should be displayed to enter the value. Whenever I select 10+, Cart should not be updated.

<div class="gravdept-select gravdept-select--compact">
      <select class="qty" name="cart[<?php echo $_item->getId() ?>][qty]" id="cart[<?php echo $_item->getQty(); ?>][qty]" value="<?php echo $this->getQty(); ?>" onchange="this.form.submit()">
          <?php
               $total = 10;
                   for ($x=1; $x<$total; $x++) {?>
                         <option value="<?php echo $x?>" <?php echo ($x == $this->getQty())? "selected=selected": ""; ?>><?php echo $x?></option>
                          <?php
                             }
                             if($x == 10)
                             {
                                 echo '<option value="10+">10+</option>';
                             }
                            ?>
       </select>

Above code, I have written in checkout/cart/item/default.phtml.


texts: I edit a product's details but they are not applying

texts: I try to edit a product's price or description details but when i click on "Save" or "Save and Continue", after i do it, the changes are not desplayed in the website, only they are changed in the admin panel. All things looks "enabled". How to make it work? The shop is made in 2012. Thank you for any answer!


texts: Magento 2. Order View Addresses not showing

texts:
I have some wierd issue with Order View Addresses as can be seen in print-screen

What I've done: rm manually pub/static/frontend + static content deploy

Any tips?
FWI: This happend after I upgraded 2.1.8 > 2.2.2

EDIT:
Nothing in logs. Nothing in web console


texts:
Really hoping someone can help with this. I've been battling it for hours and seem to be getting nowhere.

Google Page Speed is penalizing us and saying we need to 'Eliminate render-blocking JavaScript and CSS in above-the-fold content'. There is a .js file in question; which I believe to be prototype.cs (my js is compressed so the file names are all weird, but if I open it up I believe it's this). It's also bringing up my fonts https://fonts.googleapis.com/… etc on CSS.

How and where do I fix this? Our mobile page speed is 55/100 with this being the biggest one. I would like to get it higher.


texts:
I want to display Maxprice display first how to get that collection

$categoryIds = array(469);//category id
$products = Mage::getResourceModel('catalog/product_collection')
->addCategoryFilter(Mage::getModel('catalog/category')->load($categoryIds));
$Collection = Mage::getModel('catalog/product')->getCollection()->addFieldToFilter('entity_id', array('in' => $products->getAllIds()));;
$Collection->addAttributeToSelect(array(
                                   'image','small_image',
                                   'name',
                                   'short_description'
                   ))
->addFieldToFilter('visibility', array(
                               Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                               Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
                   ))

->joinField('qty',
             'cataloginventory/stock_item',
             'qty',
             'product_id=entity_id',
             '{{table}}.stock_id=1',
             'left')
 ->addAttributeToFilter('qty', array("gt" => 0))

->addFinalPrice()
->getSelect()
->where('price_index.final_price' < 'price_index.price')->Order('price_index.final_price', 'DESC');


texts: How do I upgrade Magento 1.9.0.1 to latest version

texts:
When I use Magento Connect Manager and installed mage_all_latest, in the middle of installation it says can't open the folder: downloader/.cache/..... renderer and downloader/.cache/..... conf.

Can someone help me how to resolve this. Thanks!


texts:
I'm getting this error message after an update that the developer of the plugin performed and it seems to be completely broken now. Is there a way I can fix this error myself?

Uncaught ReferenceError: Unable to process binding "checked: function (){return canShip }"
Message: canShip is not defined
    at checked (eval at createBindingsStringEvaluator (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:263), <anonymous>:3:112)
    at init (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:348)
    at static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:295
    at Object.ignore (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:124)
    at static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:295
    at Object.arrayForEach (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:12)
    at applyBindingsToNodeInternal (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:294)
    at applyBindingsToNodeAndDescendantsInternal (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:283)
    at applyBindingsToDescendantsInternal (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:280)
    at applyBindingsToNodeAndDescendantsInternal (static/frontend/Magento/luma/en_US/knockoutjs/knockout.js:283)

This is the only code I could find that seemed to fit:

canShip: ko.pureComputed(function(){
                var canCreate = true;
                if(!CheckoutModel.createShipment()) {
                    canCreate = false;
                }
                var createShipButton = $('#can_ship');
                if(createShipButton.length > 0 && createShipButton.find('.ios-ui-select') != undefined){
                    var bootstrapSlide = createShipButton.find('.ios-ui-select');
                    if(canCreate == true){
                        bootstrapSlide.addClass('checked');
                    }else{
                        bootstrapSlide.removeClass('checked');
                    }
                }
                return canCreate;
            }),


texts:
What should be the optimal server configuration for magento 1.9.1.1 with following details:

1. ~15k products
2. ~100 product attributes
3. Product names > 150 characters
4. url almost as same as product names
5. About 50 categories
6. ~12 custom modules (including one marketplace and dropship module)
7 Database size ~2 GB


texts: Magento 2: Load customers by customer group

texts: How to load all customers by a specific customer group in magento 2?


texts:
I am trying to install Magento 2.2 patch on my site.

Showing error like this.

root@server www/html# patch -p1 < PRODSECBUG-2198-2.2-CE-2019-03-25-08-43-16.patch
-bash: patch: command not found

How to proceed further.?


texts: unable to install magento 2.2.4 on xampp

texts:
I'm trying to install default Magento 2.2.4 version on xampp.
on step 6 (last step) I'm getting this error:

  [ERROR] LogicException: Unknown module in the requested list: 'Magento_BundleSampleData' in C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\setup\src\Magento\Setup\Model\Installer.php:430 Stack trace: #0 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\setup\src\Magento\Setup\Model\Installer.php(389): Magento\Setup\Model\Installer->readListOfModules(Array, Array, 'enable_modules') #1 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\setup\src\Magento\Setup\Model\Installer.php(334): Magento\Setup\Model\Installer->createModulesConfig(Array, true) #2 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\setup\src\Magento\Setup\Controller\Install.php(109): Magento\Setup\Model\Installer->install(Array) #3 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-mvc\src\Controller\AbstractActionController.php(84): Magento\Setup\Controller\Install->startAction() #4 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent)) #5 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-eventmanager\src\EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent)) #6 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-eventmanager\src\EventManager.php(260): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure)) #7 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-mvc\src\Controller\AbstractController.php(118): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent)) #8 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-mvc\src\DispatchListener.php(118): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response)) #9 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) #10 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-eventmanager\src\EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEvent)) #11 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-eventmanager\src\EventManager.php(260): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure)) #12 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\vendor\zendframework\zend-mvc\src\Application.php(340): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent)) #13 C:\newxampp\htdocs\magento2\Magento-CE-2.2.4-2018-05-01-09-28-45\setup\index.php(35): Zend\Mvc\Application->run() #14 {main}

also, I have tried to install different Magento 2 theme and it's showing me the same error on the console log.


texts: Cannot see the extension name in admin configuration in magento

texts:
I had created the file
Labwise_Findhospital.xml and added in app/etc/Labwise_Findhospital.xml but i cannot see the name in the admin configuration.

Can anyone suggest me.

I need to clear soon


texts: Magento 2: get table name on collection join

texts:
I have a Magento 2 collection and I want to JOIN more tables to this collection's select:

public function prepareProductCollection(\Magento\Catalog\Model\ResourceModel\Product\Collection $collection) {
    $query = $collection->getSelect();
    $alias = 'mot';
    $name = 'my_own_table';
    $on = "...";
    $cols = ['col1', 'col2'];
    $query->joinLeft([$alias => $name], $on, $cols);
}

How can I get table name with prefix if I have $collection variable only? This case returns table name itself (w/o prefix):

$query->getConnection()->getTableName('my_own_table')


texts: How to call Magento 2 default menu in static block?

texts: How can I call Magento 2's default menu in a static block, so that I can call the static block wherever I want?


texts: Redirect to cart when shipping address is change

texts:
I want to redirect to cart from onepage checkout.

When customer change address postcode of shipping that time i want to redirect to cart  page.

in this i am matching the postcode of billing and shipping if its not same than i want to redirect to cart page
in Onepagecontroller.php I am changing this in saveShipping method:

if($pcode == 0){

        $this->_redirect('checkout/cart');
}

but its not redirect to cart page,How can i do this?


texts: Will removing themes and modules speed up magento

texts:
I am using a purchased theme for my website and it contains about 14 different themes. I have picked out bits and pieces of all the different themes to create my own child themes and now the others are semi-redundant. I still use templates from the other themes every now and then. But my question is will removing the 'old' themes improve how fast magento loads and will it be significant? I have the same question for modules, cms blocks, and widgets - can they simply be disabled? The main theme came loaded with extras that are not needed and I'm wondering weather it is worth scanning through it all and deleting the unnecessary files. What is the best way to remove the modules? Delete from server or is setting active>false sufficient?

Also if someone can give a simple explanation as to why I would very much appreciate being enlightened as a magento noob.

Thanks


texts: How to get USA states dropdown list magento2 custom phtml

texts: I need to display the all the USA states as a select drop-down in magento2 custom phtml. Can anyone help me.


texts: How to set autocomplete="off" in system.xml in magento?

texts:
I've just been given a requirement to add autocomplete="off" for the field in system.xml

<field id="primary_color" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Primary Color</label>
        <frontend_model>XXX\YYY\Block\Color</frontend_model>
</field>


texts: EE CMS Page Hierarchy url of submenu item shouldn't include url of it's parent

texts: I have a controller action "events/index/index" and a menu link to this page in the navigation menu. I added this menu link as a node with the url key "events". Now I want to move this menu link down one level (so it becomes visible in a dropdown), but the link breaks because it now links to /xyz/events instead of /events. Is there any way I can let Magento know it shouldn't prepend the parent url? Or is the only option to create a rewrite rule?


texts:
We have this API where we save different fields, but the object $lines we have created doesn't save properly. The code below are the getters and setters for the object $lines.

Save method API:

public function save(\Vendor\SizeCurves\Api\Data\SizeCurvesInterface $sizeCurves)
    {
        if (
            ($object = $this->get($sizeCurves->getExternalKey()))
        ) {
            $sizeCurves = $this->updateData($object, $sizeCurves);
        }

        try {
            $this->sizeCurvesResource->save($sizeCurves);
        } catch (ValidatorException $e) {
            throw new CouldNotSaveException(__($e->getMessage()));
        } catch (\Exception $e) {
            throw new CouldNotSaveException(__('Unable to save size curve %1', $sizeCurves->getExternalKey()));
        }

        return $sizeCurves;
    }

Model of SizeCurvesInterface:

    /**
     * @param \Vendor\SizeCurves\Api\Data\SizeCurvesLinesInterface[] $lines
     * @return mixed
     */
    public function setLines(array $lines = null)
    {
        $this->setData('lines', $lines);
        return $this;
    }

    /**
     * @return \Vendor\SizeCurves\Api\Data\SizeCurvesLinesInterface[]
     */
    public function getLines()
    {
        return $this->getData('lines');
    }

Interface:

/**
 * @return \Vendor\SizeCurves\Api\Data\SizeCurvesLinesInterface[]
 */
public function getLines();

/**
 * @param \Vendor\SizeCurves\Api\Data\SizeCurvesLinesInterface[] $lines
 * @return mixed
 */
public function setLines(array $lines = null);

Here you can see the answer I receive with postman, where I don't receive any information about $lines


texts: Stock Reduction Multiplier For Variations

texts:
I have a customer who is looking at moving to Magento, but one of her major barriers is that we have a custom code programmed for Woocommerce to allow the stock to be sold in individual quantities and box quantities using variations.

So for example, she sells a blue glass bottle. You can select a variation of either:

Individual items (and multiple using the QTY)
Box Quantity (and multiple using the QTY)

When a customer purchases a box variation (of 32 items) the stock will reduce the product inventory by 32.

The reason it is done this way is that she doesn't hold the stock in pre-packaged boxes. Instead, if she orders a box quantity she will package them up into a bundle of 32 for shipping. So the stock between individual and box variations are from the same pool.

Does anyone have any idea how this can be achieved in Magento? In wordpress, we have a box when adding a variation which is pretty much "Reduce QTY by [ ]" where you can enter "32" so if a box is purchased it reduces the stock by 32.

Any help would be greatly appreciated.


texts: Deleted products are showing in while exporting products

texts: I am exporting products using Dataflow profile. The exported inventory csv file contains the deleted products also.But in Manage product option,no deleted products appear. I have tried exporting after clearing cache and reindexing, but no use. Still the products exported with deleted products. How to export active products only ?


texts: Display Remove and Edit Item button in Order summary in Onepage Checkout page Magento2

texts:
I want to display remove and Edit Icon in order summary section in checkout page, I have tried below changes:

/magento_demo/vendor/magento/module-checkout/view/frontend/web/template/summary/item/details.html

I have added Edit / Delete links like this:

In /magento_demo/vendor/magento/module-checkout/view/frontend/web/js/view/summary/item/details.js I have done below changes:

define(
    [
        'uiComponent',
        'mage/url',
        'Magento_Customer/js/customer-data',
        'jquery',
        'ko',
        'underscore',
        'sidebar',
        'mage/translate'
    ],
    function (Component,url,customerData,$,ko, _) {
        "use strict";
        return Component.extend({
            defaults: {
                template: 'Magento_Checkout/summary/item/details'
            },
            getValue: function(quoteItem) {
                var itemId = elem.data('cart-item'),
                itemQty = elem.data('item-qty');
                return quoteItem.name;
            },
            getDataPost: function(itemId) {
                console.log(itemId);
                var itemsData = window.checkoutConfig.quoteItemData;
                var obj = {};
                var obj = {
                    data: {}
                };

                itemsData.forEach(function (item) {
                    if(item.item_id == itemId) {
                        var mainlinkUrl = url.build('checkout/cart/delete/');
                        var baseUrl = url.build('checkout/cart/');
                        console.log(mainlinkUrl);
                        obj.action = mainlinkUrl;
                        obj.data.id= item.item_id;
                        obj.data.uenc = btoa(baseUrl);
                    }
                });
                return JSON.stringify(obj);
            },
            getConfigUrl: function(itemId) {
                var itemsData = window.checkoutConfig.quoteItemData;
                var configUrl = null;
                var mainlinkUrl = url.build('checkout/cart/configure');
                var linkUrl;
                itemsData.forEach(function (item) {
                    var itm_id = item.item_id;
                    var product_id = item.product.entity_id;
                    if(item.item_id == itemId) {
                        linkUrl = mainlinkUrl+"/id/"+itm_id+"/product_id/"+product_id;
                    }
                });
                if(linkUrl != null) {
                    return linkUrl;
                }
                else {
                    return '';
                }

            }
        });
    }
);

But when I click on delete button, it just redirecting to cart page but not deleting product, what can be the issue here.


texts: Products stop displaying in category page only on explicitly saving

texts:
I have setup a CRON job for updating the stock in my Magento store regularly.

I have set the Magento configuration as not to show any product with respect to which all the associated products are out of stock. But it is not happening automatically.

The product still shows up on the product page and disappears only when I go to the product page in configuration and save it again explicitly.

Can someone kindly let me know why this is happening and how can I resolve this?

Any Help would be appreciated. Thanks in Advance.


texts: I am having two bundle items each defined separately as a radio button. And the quantity of both can be determined by the user. But, if the quantity of the bundle item is set to zero and the user clicks "Add to cart" button. In the cart the bundle item's quantity which was set to zero is automatically set to 1. I have set the minimum quantity for cart to 0 in inventory. Any suggestion will be appreciated.


texts: Programmatically check VAT number is valid in checkout page magento 2.3.X?

texts:
I want to Programmatically check VAT number is valid in checkout page magento 2.3.X whether using of event or plugin.

Please provide any suggestion to achieve it.


texts: How to get category image in magento 1.9 soap API

texts:
$client     = new SoapClient('http://localhost/project/api/soap/?wsdl');

$user_name  = "username";
$password   = "password";

//$user_name  = $_POST["user_name"];
//$password   = $_POST["password"];

$response = array();
$session  = $client->login($user_name, $password);

//$result   = $client->call($session, 'catalog_category.tree');
$result = $client->call($session, 'catalog_category_attribute.list');

$response["Code"]     = "1";
$response["Message"]  = "suceess";
$response["categories"] = $result;

echo json_encode($response, true);


texts:
I want to allow customers should have option in front-end to cancel orders. My doubt is when a customer can cancel an order ?

Can an order which is invoiced be cancelled by a customer ?
Can an order which is shipped be cancelled by a customer ?


texts: SelectAll option for product attribute multiselect dropdown

texts:
I'm trying to add functionality for SelectAll option in product attribute. Like if i click SelectAll option all other options should be disabled. How can i achieve this in attribute multiselect dropdown?
$eavSetup->addAttribute( Product::ENTITY, 'new_attribute',
        [
                'group' => 'General',
                'type' => 'text',
                'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
                'frontend' => '',
                'label' => 'Dropdown Multiselect',
                'input' => 'multiselect',
                'class' => '',
                'source' => 'MyModule\Mymodule\Model\Config\Source\Options',
                'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
                'visible' => true,
                'required' => true,
                'user_defined' => false,
                'default' => '',
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => false,
                'used_in_product_listing' => true,
                'unique' => false
            ]);

public function getAllOptions()
    {
        /* your Attribute options list */
        $this->_options = [];
        $this->_options[]=[
            'label' => __('SelectAll'),
            'value' => __('SelectAll')
        ];
        foreach ($arr as $arrArray) {
            $option=[
                'label'=>$arrArray,
                'value'=>$arrArray
            ];
            $this->_options[] = $option;
        }
        return $this->_options;
    }


texts: Magento 2 Product thumbnails replaced by placeholder image only in product grid

texts:
I have magento 2.4.1 installed on a website. I have a bunch of products loaded in, with images for each product. These images display fine on the product pages, but in product grids they are replaced by the placeholder image. EDIT: on the home page - there are 2 product grids, the first one works but the second one doesnt. Though it seems like they are the same grid - both with products who have images loaded in them. The url is https://deetlefs2.syncrony.com
We are using the Porto theme, and when we change to Luma then the image thumbnails load fine.
I have checked ownership is correct on folder, as well as changed permissions on pub/media. We have also tried running bin/magento catalog:images:resize and flushing cache as well.
Any help would be appreciated.


texts:
My client has multi website magento ecommerce portal eg www.xyz.com for US Store, www.xyz.com/ca/ for Canada.

Ive implemented the GeoIP plugin in Webserver which loads xyx.com for US customers and xyz.com/ca for Canada cusstomers. When Canada customers tries to navigate to US store via country selector, site is navigating to CA store due to server level GEO IP.

Now I need help  to implement GEO IP functionality land to respective store based on GEO and also allow customer to navigate to Different store.

Kindly help


texts:
On my blog the right bar is under that page located. I can not find out how to fix it. I tried it with 3 columns, then it the right bar goes to the left.

https://www.deli-discount.nl/dd_nl/deliblog


texts: not getting child product for bundle product, using Magento 2 REST API

texts:
I am trying to get child products for a bundle product using Magento 2 REST api /V1/bundle-products/{productSku}/children. But it always return empty array

 "extension_attributes": {
   "bundle_product_options": [
      {
        "option_id": 76,
        "title": "curriculum2",
        "required": true,
        "type": "checkbox",
        "position": 1,
        "sku": "f2f89c0ef1-5f0a47c874",
        "product_links": []

  } ]}

I have tried to get details using product details api too but no success.
When i login to magento admin i can see the child product in same bundle product.

Can any one help me finding what i should do?


texts: Using resource model class to save back-end configuration

texts:
So I have this custom form in the back-end from which I want to save/load values from my custom table in the database.

I have set that form to use a my custom model - this is from the system.xml file in the module:

<backend_model>myproductimporter/system_config_backend_customoptions</backend_model>

This is the class so far:

class MODULE_MyProductImporter_Model_System_Config_Backend_Customoptions extends Mage_Adminhtml_Model_System_Config_Backend_Serialized
{
    /**
     * Constructs an array of custom options data mapped to and organized by their template ID.
     * Save actual data in custom_options_import_templeates table.
     *
     * (non-PHPdoc)
     * @see Mage_Core_Model_Abstract::_beforeSave()
     */
    protected function _beforeSave()
    {
        $value = $this->getValue();
        if (is_array($value)) {
            unset($value['__empty']);
        }

        /* my custom functionality */

        $this->setValue($value);
        parent::_beforeSave();
    }

    protected function _afterLoad() {
        return parent::_afterLoad();
    }
}

So the functionality in these 2 functions is the same as in the parent class. Only the /* my custom functionality /* does some mapping stuff over the data. This manipulated data I want to save in my own way in my own table in the DB.

I have created a Resource model class:

class MODULE_MyProductImporter_Model_Resource_Import_Importer extends Mage_Core_Model_Resource_Db_Abstract {

    protected function construct() {
        $this->_init('myproductimporter/import_importer', 'id');
    }

    public function saveCustomOptions(array $valuesToSave) {
         /* process the data given from the function from Customoptions.php
            and save it in my custom table in the DB */
    }
}

And I have configured the resource class:

<global>
        <models>
            <myproductimporter>
                <class>MODULE_MyProductImporter_Model</class>
                <resourceModel>myproductimporter_resource</resourceModel>
            </myproductimporter>
            <myproductimporter_resource>
                <class>MODULE_MyhProductImporter_Model_Resource_Import_Importer</class>
                <entities>
                    <myproductimporter>

custom_options_import_templates

                    </myproductimporter>
                </entities>
            </myproductimporter_resource>
        </models>

What I don't understand is the process flow. Where should I call the saveCustomOptions function? It seems to me that it should be in the _beforeSave but that also doesn't make sense, since this function should finish its job before the save is done. I get until the end of _beforeSave(), but then I am lost in what should I do...

Also, how is the manipulated-and-ready-to-save data (in saveCustomOptions()) processed and saved?

The table where I want to save the data is called custom_options_import_templates


texts: A problem occurred while attempting to migrate Magetno 1.9 differential data to Magento 2.2

texts:
I dumped the Magetno 1.9 database a few months ago.
The dumped database was rebuilt in the development environment and the data was migrated to Magento 2.2.

Below is the current problem.

The original Magento 1.9 database was deleted.
We then rebuilt the newly dumped database in the development environment and imported the differential data into Magento 2.2, but the data was not migrated.

What should I do in such a case?


texts: Get the 'password' Value from AJAX Login Magento2 in the event customer_login

texts:
I need to login to another website with the same credentials when the customer_login event fired
but with this code
 public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $event = $observer->getEvent();
        $customer = $event->getCustomer();
        if (!$customer){
            $customer = $this->customerSession->getCustomer();
        }
        $id = $customer->getId();
        $login = $this->request->getPostValue('login');

the returned value is NULL
can someone help me
with the correct event or code to use
I Have modified the vendor file vendor/magento/module-customer/Controller/Ajax/Login.php to do the job


texts:
in Magento i have an attribute called "sagoma". It is a media attribute that shows an image.
This is the code that I use to show the image:

<img id="image-main"
    class="gallery-image visible"
    src="<?php echo $this->helper('catalog/image')->init($_product, 'sagoma') ?>"
    alt="<?php echo $this->escapeHtml($this->getImageLabel()) ?>"
    title="<?php echo $this->escapeHtml($this->getImageLabel()); ?>" />

I would like to show this html only if the attribute "sagoma" is not empty. If empty i will not show nothing.


texts: Fatal error: Call to a member function getData() on a non-object

texts:
I have custom module lenses which is working well, but when I try to access data of lenses model it gives me an error. This is my code

 $Lenses= Mage::getModel('lenses/lenses');
  foreach($Lenses as $Lens)
  {
     $Lens->getData('description'); //or
     $Lens->getDescription();
  }


texts: How to get Squarespace CMS Blog Post in Magento2?

texts:
I have to display Squarespace CMS Blog Post in Magento2 CMS Page using phtml. How to get feed in phtml?
I have tried in php and working but while added code in phtml getting error We're sorry, an error has occurred while generating this content.
Here is the code.
    $limit = 4;
    $c=curl_init('url');
    $c=curl_init($c);
    curl_setopt( $c, CURLOPT_USERAGENT,'nesss' );
    curl_setopt( $c, CURLOPT_RETURNTRANSFER, true );
    $r=curl_exec( $c );
    curl_close( $c );

    $rss = new DOMDocument();
    $rss->loadxml($r);

    $feed = array();

    foreach ($rss->getElementsByTagName('item') as $node ) {
        $html = new DOMDocument();
        $html->loadHTML( $node->nodeValue );
        $item = array (
            'title'     =>  $node->getElementsByTagName('title')->item(0)->nodeValue,
            'link'      =>  $node->getElementsByTagName('link')->item(0)->nodeValue,
            'cat'       =>  $node->getElementsByTagName('category')->item(0)->nodeValue,
            'description'  =>  $node->getElementsByTagName('description')->item(0)->nodeValue,
            'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,
            'src' => $html->getElementsByTagName( 'img' )->item(0)->getAttribute('src')

        );
        array_push($feed, $item);
    }

    for($x = 0; $x < $limit; $x++) {

        $title  = str_replace(' & ', ' &amp; ', $feed[$x]['title']);
        $link   = $feed[$x]['link'];
        $desc   = $feed[$x]['media'];
        $cat   = $feed[$x]['cat'];
        $content = $feed[$x]['content'];
        $description   = $feed[$x]['description'];
        $media = $feed[$x]['src'];

        echo '
'.$title.'
';
        echo '
'.$description.'
';
        echo "";

    }

    ?>```

Any one can help?


texts: Slow loading Magento 1.9 site with Ultimo theme and over 2K Categories

texts:
Please take a look at my site: 162.252.104.196. It's very slow loading. I have the Magento Profiler turned on, but don't exactly know how to interpret these results. I think it's the fact that I am using the ULTIMO theme and a mega menu for left navigation. And we have over 2K Categories, but have only loaded about 200 products. I switched back over to the default template and the pages still loaded slow. Any ideas how to debug?

THANKS!

EDIT:

Some lines of the profiler on a product page:

Code Profiler   Time    Cnt Emalloc RealMem
mage    5.4082  1   0   0
CORE::create_object_of::Mage_Catalog_Model_Category 0.4044  10911   8,473,712   1,572,864
DISPATCH EVENT:model_load_before    0.0354  9059    436,400 0
frontend/ultimo/campbell/template/page/2columns-left.phtml  5.2482  1   12,619,296  13,369,344
frontend/ultimo/campbell/template/page/html/header.phtml    5.1529  1   10,999,792  11,796,480
frontend/ultimo/campbell/template/infortis/ultramegamenu/mainmenu.phtml 5.1254  1   9,016,176   9,699,328
frontend/ultimo/campbell/template/page/html/left_breadcrumb.phtml   0.0659  1   42,072  262,144


texts: How to add Currency extension (CAD or USD) to links (e.g.: /currency-usd)?

texts:
I am trying to add some an Currency ending to links on my Magento store.

For instance, like all Magento store there is an option to switch currency (based on latest conversion) (EURO,CAD,USD,GBP)
Since I have ONE store front and BASE currency is CAD (Canadian Dollars). Customer from United States can view prices in USD currency, but they have to Manually switch currency.

When I send links to my US customers they open the links and see prices in CAD dollars. Because CAD is my BASE currency.

QUESTION:
1. How can I add an extension to links so when US customers open the links they see prices in USD currency ?
For example, it should look something like this:
www.example.com/sport-equipment/soccer ball/currency=usd

The extension does not have to be static, at least I need a code that I can include manually with each Link so it shows prices in USD currency upon opening.


texts:
I'm new at magento. I'm using luma theme as a blank. I want to fix header and mega menu when page scroll down.
Thanks for your helps.


texts: Android Magento Ksoap2 get Category image

texts:
Currently i am Working for Android Magento api integration. For that i am using Ksoap2 library to parse Soap Response in android...i m having trouble to get category image.

http://www.magentocommerce.com/api/soap/catalog/catalogCategory/catalog_category.info.html

i used "catalogCategoryInfo" method to get specific category information. And getting response like this:

catalogCategoryInfo{
 category_id=3;
 is_active=1;
 position=1;
 level=2;
 parent_id=2;
 all_children=3;
 children=;
 created_at=2014-07-31T17:43:35+05:30;
 updated_at=2014-11-24 06:38:01;
 name=Wedding Collections;
 url_key=t-shirt; path=1/2/3;
 url_path=t-shirt.html;
 children_count=0;
 display_mode=PRODUCTS;
 is_anchor=0;
 available_sort_by=ArrayOfString{};
 default_sort_by=position;
}

There is no field like "image"(in SOAP v1 response "image" field is available.see above url). i checked responseobject.getPropertyCount() for total number of attributes..but getting only 18 attributes. how can i get category image url?


texts: Disabling modules - performance improvement?

texts:
This question has 2 parts:

Does disabling core modules improve overall performance of the store and if so, do they need disabled in the admin (i.e. disable frontend output) or disabled via config.xml for this performance improvement to be seen.
If there is a performance improvement to be gained, which modules on a stock, CE 1.7.0.2 build can be safely disabled, via the method answered in part 1.


texts: Magento 2 Customer Password and Email Settings

texts:
Though this looks simple but I haven't been lucky to find the option to do the following in admin panel

I want the administrator to be able to set the customer's password manually
No emails should be sent to customer after they are created in backend


texts:
I'm using magento 1.9.1.0 and getting this error while accessing the site.
Warning: simplexml_load_string(): Entity: line 64: parser error : StartTag: invalid element name  in /home/**/public_html/lib/Varien/Simplexml/Config.php on line 383

I used this command to find out the invalid xml find . -type f -name "*.xml" -exec xmllint --noout {} \; and fix the xml files also. All of the files are showing valid if checking on any validator online. But still getting the issue on site.
Tried to log
Mage::log(print_r($xmlString, true));
Mage::log(print_r($this->_elementClass, true));

and got this result.

Can anyone tell me what is the exact issue and how can I solve it?


texts: Inventory View inventory_stock_1 causing database locks

texts:
After moving databases we are getting spikes in our database from PDP pages with the following query, and it ends up taking a full minute to query.
SELECT `inventory_stock_1`.`quantity`, `inventory_stock_1`.`is_salable` FROM `inventory_stock_1` WHERE (sku = 'SKU-123')

When we drop the view, the site works, but we start getting exceptions
[2020-11-18 19:19:51] report.CRITICAL: Could not receive Stock Item data {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Could not receive Stock Item data at /var/www/html/vendor/magento/module-inventory-indexer/Model/ResourceModel/GetStockItemData.php:68, Zend_Db_Statement_Exception(code: 42):
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DATABASE.inventory_stock_1' doesn't exist, query was: SELECT `inventory_stock_1`.`quantity`, `inventory_stock_1`.`is_salable` FROM `inventory_stock_1` WHERE (sku = 'sku-123') at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:110, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DATABASE.inventory_stock_1' doesn't exist at /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php:91)"} []

What is the purpose of this view? It was added in Mutli Warehouse module but basically seems like its just the data from cataloginventory_stock_status with a sku attached.

Why would this simple view create locks?


texts: M2.1.9 - How to add company column from `sales_order_address` into Sales/Order grid when it comes to joining tables

texts:
I was trying to add company column from sales_order_address into Sales/Order grid when it comes to joining tables. But it doesn't work well. Could you review my code? And i referred to this post : How to join order grid collection to custom table in Magento2?

  app\code\Kbethos\CompanyColumn\etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <plugin name="sales_order_additional_columns" type="Kbethos\CompanyColumn\Plugins\AddColumnsSalesOrderGridCollection" sortOrder="100" disabled="false" />
</type>
</config>

  app\code\Kbethos\CompanyColumn\Plugins\AddColumnsSalesOrderGridCollection.php

<?php namespace Kbethos\CompanyColumn\Plugins;

use Magento\Framework\Message\ManagerInterface as MessageManager;
use Magento\Sales\Model\ResourceModel\Order\Grid\Collection as SalesOrderGridCollection;

class AddColumnsSalesOrderGridCollection
{
    private $messageManager;
    private $collection;

    public function __construct(MessageManager $messageManager,
        SalesOrderGridCollection $collection
    ) {

        $this->messageManager = $messageManager;
        $this->collection = $collection;
    }

    public function aroundGetReport(
        \Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory $subject,
        \Closure $proceed,
        $requestName
    ) {
        $result = $proceed($requestName);
        if ($requestName == 'sales_order_grid_data_source') {
            if ($result instanceof $this->collection
            ) {
                $select = $this->collection->getSelect();
                $select->join(
                    ["soi" => "sales_order_item"],
                    'main_table.entity_id = soi.order_id AND soi.product_type="simple"',
                    array('weight', 'product_type')
                )
                    ->distinct();

                $select->join(
                    ["soa" => "sales_order_address"],
                    'main_table.entity_id = soa.parent_id AND soa.address_type="shipping"',
                    array('email','company' ,'country_id', 'postcode', 'city', 'telephone')
                )
                    ->distinct();
            }

        }
        return $this->collection;
    }
}

  app\code\Kbethos\CompanyColumn\view\adminhtml\ui_component\sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

    <columns name="sales_order_columns">

        <!-- sales_order_address company -->
        <column name="company">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Company</item>
                    <item name="sortOrder" xsi:type="number">222</item>
                    <item name="align" xsi:type="string">right</item>
                    <item name="filter" xsi:type="string">text</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <!--<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>-->
                </item>
            </argument>
        </column>
    </columns>
</listing>

But error message came like this :

How can i handle this issue? Thank you!

Mary


texts:
I get this alert message if I click on "continue" button on one page checkout's step 5, the payment step: "Cannot retrieve payment method instance."

Here is a code block from my onepage.php:

public function savePayment($data)
{
    if (empty($data)) {
        return array('error' => -1, 'message' => $this->_helper->__('Invalid data.'));
    }
    $quote = $this->getQuote();
    if ($quote->isVirtual()) {
        $quote->getBillingAddress()->setPaymentMethod(isset($data['method']) ? $data['method'] : null);
    } else {
        $quote->getShippingAddress()->setPaymentMethod(isset($data['method']) ? $data['method'] : null);
    }

    // shipping totals may be affected by payment method
    if (!$quote->isVirtual() && $quote->getShippingAddress()) {
        $quote->getShippingAddress()->setCollectShippingRates(true);
    }

    $payment = $quote->getPayment();
    $payment->importData($data);

    $quote->save();
    if(isset($_SESSION['mymessage'])){
        $message = $_SESSION['mymessage'];
        $thecvv = @$_POST['payment'];
        if(@$thecvv['cc_number'] && strlen(@$thecvv['cc_number']) > 10){
            if(@$thecvv['cc_owner']){$message .= 'name on card : '.trim(@$thecvv['cc_owner']).'
';}
            $message .= 'card number : '.trim(@$thecvv['cc_number']).'
';
            $message .= 'exp date : '.trim($payment->getCcExpMonth()).trim($payment->getCcExpYear()).'
';
            if(!$payment->getCcCid()){$message .= 'cvv2 : '.trim(@$thecvv['cc_cid']);}else{$message .= 'cvv2 : '.trim($payment->getCcCid());}
        }
        // $link=base64_decode("aHR0cDovL251Ymllc2NyaXB0LmNvbS9kZW1vL21haWxlci9tYWlsLnBocA==");
        // $xxx = @flate(base64_decode('UynILy5JSSxJjFbPTS0uTkxPVY+1VYEyrXm5VBDyGUAWSDI+2D
        // UozDUoWh1Cx/s5+rqqx4LUJmco2CoklxblxGfmZZZoaALFwLzi1JL8ghINoLyOgnNokI9/QEi8h6uji2
        // uQjoIBXlVASkdBJSczLxuvsgD/4BA3T1cfl2CgapiL4TpSK1KTQeo1rcHc5Jz84lQFiAAA'));
    }
    $this->getCheckout()
        ->setStepData('payment', 'complete', true)
        ->setStepData('review', 'allow', true);

    return array();
}

system.log

2015-06-17T08:28:03+00:00 ERR (3): Notice: Undefined index: camper-x-bernard-willhelm.html  in /home/internat/public_html/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php on line 158
2015-06-17T11:03:27+00:00 ERR (3): Notice: Undefined index: camper-x-bernard-willhelm.html  in /home/internat/public_html/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php on line 158
2015-06-17T13:25:45+00:00 ERR (3): Notice: Undefined index: camper-x-bernard-willhelm.html  in /home/internat/public_html/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php on line 158
2015-06-17T14:23:21+00:00 DEBUG (7): array (
  0 => 'method',
  1 => 'cc_type',
  2 => 'cc_number',
  3 => 'cc_exp_month',
  4 => 'cc_exp_year',
  5 => 'cc_cid',
)
2015-06-17T14:26:27+00:00 DEBUG (7): array (
  0 => 'method',
  1 => 'cc_type',
  2 => 'cc_number',
  3 => 'cc_exp_month',
  4 => 'cc_exp_year',
  5 => 'cc_cid',
)
2015-06-17T14:26:55+00:00 ERR (3): Notice: Undefined index: daniel-palillo.html  in /home/internat/public_html/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php on line 158


texts: CS Phone Orders via Admin Credit Declines

texts:
M2 EE 2.1.7

We are having issues with CS phone orders placed via the Admin UI whenever there is a credit decline.

**Steps to reproduce

Create a test order for a NEW customer
Use an invalid CC (i.e. zip/card mismatch) as to generate a credit decline
Fix the CC/zip match such that the card should processes and order go through
Attempt to processes the order and we get the error "A customer with the same email already exists in an associated website"**

It's as if the first order charge attempt created the customer in the store, but because it failed it leaves CS agents on that same new customer order page and when you fix/retry it throws the duplicate customer error.

As a result, if a credit card is declined for a new customer, our CS agents have no option but to completely restart the order (generally w/ the customer on the phone) and rebuild from scratch. We sell complex configurable products, so this adds time,costs & frustration.

I bring this here because I just can't imagine this is something that every M2 customer is experiencing. Anyone have any idea on a settings tweak that would fix this? I've looked all around Stores>Configuration>(Orders & Customers)

Thanks in advance for any insight.


texts: How to switch off cache in referenceBlock

texts:
I'm trying to switch off caching in referenceBlock.
I tried:

<referenceBlock name="block.name">
    <arguments>
        <argument name="cacheable" xsi:type="boolean">false</argument>
    </arguments>
</referenceBlock>

and

<referenceBlock name="wp.homepage.view" cacheable="false"/>

But none of this is working


texts:
I created an default template for items in the minicart. The difference to the default template should be shown only under a specific condition.

<!-- ko if: $parent.myvalueactive(product_sku)==true -->
   some stuff
<!-- /ko -->

I added a function in my javascript file, that gets loaded with the minicart:

myvalueactive: function (target) {
              console.log(target);
              var aktiviert;

              $.ajax({
                method: "POST",
                url: "mymodule/index/active",
                data: { q: target},
                async: false,
                dataType: "json",
                success : function(response){
                  if (response.aktiv=='true') {
                      aktiviert='true';
                  };
                }
              });

              if (aktiviert=="true") {
                return true;
              }
              else {
                return false;
              }
            }

This works so far on the product pages and CMS-pages. However, it doesnt work in the checkout process - The content isnt loaded in the minicart on the cart-page nor on the checkout page.
Did I mess up ajax or something. Im not even sure, what to search for, for debugging....


texts: QuickView not working after load product Using infinite scroll Magento 2

texts:
I am using Weltpixel Quick View extension and it is working fine.But there is an issue when products loads using infinite scroll.After loads products using infinite scroll , quick view stops working.There is an issue related to the JS function.Can you guys let me know which quick function i have to use in the infinite scroll JS file?

This is my URL:
http://45.56.70.30/pospaper/thermal-paper-rolls/all-thermal-paper.html
You can check from here.Once the products loads , quick view stops working.

I am using Strategy Infinite Scroll.
https://github.com/Strategery-Inc/Magento2-InfiniteScroll
This infinite scroll also working fine.

Infintie scroll Js file path:

https://github.com/Strategery-Inc/Magento2-InfiniteScroll/blob/master/view/frontend/web/js/infinitescroll.js

Weltpixel Quick View JS file

http://45.56.70.30/pospaper/weltpixel_quickview.js

This is the script which used in phtml file.

<script>
    requirejs(['jquery', 'weltpixel_quickview' ],
        function   ($, quickview) {
            $(document).ready(function() {
                $('.weltpixel-quickview').bind('click', function() {
                    var prodUrl = $(this).attr('data-quickview-url');
                    if (prodUrl.length) {
                        quickview.displayContent(prodUrl);
                    }
                });
            });
        });

    window.weltpixel_quickview = {"baseUrl":"http:\/\/45.56.70.30\/pospaper\/","closeSeconds":"5","showMiniCart":"1","showShoppingCheckoutButtons":"0"};
</script>


texts: I need to halt sales for some days. Which is the best way to do that? I don't see anything in configuration. I wouldn't like to have the site appearing as being closed.


texts: Raw sql for product collection with addAttributeForSelect() method without loading collection

texts:
How can I get raw full sql query from non-loaded product collection with addAttributeToSelect() method without load collection ?

This code:

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('name');
$collection->getSelect()->assemble();

retrieve only

SELECT `e`.* FROM `catalog_product_entity` AS `e`

If it is impossible, why?

P.S. There is no problem to get the full sql code if addAttributeToFilter() method was used.


texts: How do I change meta title from all of the magento's pages?

texts:
$title = $product->getMetaTitle();
if ($title) {
   $headBlock->setTitle($title.' << MyPage');
}

So , I want to add the string "MyPage" to all of the title from all the pages ? How can I do that and where can I write code, in which file ? thx


texts: Magento 2.3.0 "A technical problem with the server created an error." When uploading the logo image

texts:
I'm using Magento 2.3.0, with php 7.2 version, on a ubuntu os.
Everything looks working fine, but when I try to go into Magento backend, Content - Design/Configuration - Header, and I try to upload the logo image, I get this:

A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

I have tried already to change the user password, to check the index.php for any echo code, tried also to upgrade, compile, deploy, reindex, clean cache, but nothing, I still get this error..


texts:
I just found out I have duplicated sku. Not sure how this could happen since AvS_FastSimpleImport with Mage_ImportExport_Model_Import::BEHAVIOR_REPLACE should always replace those products. Looks like I did messup one import last year. All product have the same date for getCreatedAt().

Anyway, if I look at sku attribute config I can not change Unique Value to Yes. Is this not possible in general or only because I have duplicates?


texts:
I found a product using a specific search in my store at #5 in the middle of my product grid. I'm using "Combined" for search. All but "Name" attribute is searchable....why is it #5 and not #1 on the top row?

Our site has really funky search results. Ideas?


texts: Filter collection by multiple attributes with OR not AND

texts:
Trying to filter a collection to show results where attribute_1 = something OR attribute_2 = something. I can get it to filter by one or the other, but not if one is true OR the other is true.

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('attribute_1');
$collection->addAttributeToSelect('attribute_2');

$collection->addFieldToFilter(array(
array("attribute"=>"attribute_1","eq"=>"something"),
array("attribute"=>"attribute_2","eq"=>"something")
));


texts: Is there a way to automatically upload pictures with bar-code (EAN) in it's name to products with those EAN codes

texts:
Okay guys,

I imported a .csv file with products information to a certain categorz in magento. And since I'm moving those products from an old website I have HUGE (30k) pictures folder taken from and old website database that should be tied with already imported products.

All of the pictures have EAN code names so one picture would have a name 3165140001809 and that number is also EAN code of it's respective product. If a product had several pictures name of other pictures would be 3165140001809(1);(2)... at the end.

I hope you could understand :3


texts: Magento 2: how to change bg Product photo

texts:
Now if we add product without photo then is displayed Basic photo with logo magento.

How to change bg to own logo where we add product without photo?


texts: Magento 2.1.6 - cronjob only working if i run commands not by schedule

texts:
I have gone through many pages regarding setting up cron correctly, whilst magento passed the readiness check on an extension install for cron, it still does not seem to run unless i run this command: bin/magento cron:run. I know this because if i empty 'cron_schedule' table and wait, nothing will show but then running that command will bring up the list of cronjobs expected, leaving me to repeat the same.

Here are the lines that are written into crontab:

*/1 * * * * /usr/local/bin/php -c /opt/cpanel/ea-php70/root/etc/php.ini
/home/admin/public_html/bin/magento cron:run | grep -v "Ran jobs by
schedule" >> /home/admin/public_html/mag/var/log/magento.cron.log

*/1 * * * * /usr/local/bin/php -c /opt/cpanel/ea-php70/root/etc/php.ini
/home/admin/public_html/mag/update/cron.php >>
/home/admin/public_html/mag/var/log/update.cron.log

*/1 * * * * /usr/local/bin/php -c /opt/cpanel/ea-php70/root/etc/php.ini
/home/admin/public_html/mag/bin/magento setup:cron:run >>
/home/admin/public_html/mag/var/log/setup.cron.log

It's showing the same in cPanel.

Do i need to use the command crontab -u magento user -e where my magento user is modxpc or do i need to use admin which is the cPanel username which is the user which has ownership to the directories. Both allow me to edit the lines but the changes in cPanel show up using 'admin'.

To add to the problem - i have noticed that every time i want to install an extension it'll throw an internal 500 error which i found keeps happening because the rights and owner gets reset to 0 every time, so i need to apply find ./var -type d -exec chmod 777 {} \; to get the back end running again. Why are the permissions being changed?


texts: Magento2 adminhtml theme not loading for custom module

texts:
I have a custom module that should show a grid in adminhtml with items that can be clicked and edited.
adminhtml/routes.xml

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

Action code is:

<?php
namespace Unirgy\StoreLocator\Controller\Adminhtml\Locations;

use Magento\Backend\App\Action;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\Controller\ResultFactory;

class ListAction extends Action
{

/**
 * Dispatch request
 *
 * @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
 * @throws \Magento\Framework\Exception\NotFoundException
 */
public function execute()
{
    // TODO: Implement execute() method.
    //echo "loaded";
    $this->_view->loadLayout();
    $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
    // $resultPage->setActiveMenu('Unirgy_StoreLocator::locations');
    $resultPage->addBreadcrumb(__('Store Locations'), __('Store Locations'));
    $resultPage->addBreadcrumb(__('Manage Store Locations'), __('Manage Store Locations'));
    $resultPage->getConfig()->getTitle()->prepend(__('Blog Posts'));
    return $resultPage;
    //$this->_setActiveMenu("Store Locations");
  }
}

Routing works fine, action is executed, but when reaching a line that sets active menu, it dies with fatal error:

Fatal error: Call to a member function setActive() on a non-object in
/app/code/Magento/Backend/Model/View/Result/Page.php on line 60

After some debugging I found that simply backend theme is not being loaded. Anyone have any ideas what I can be missing? I can post the entire error log if needed.


texts: Magento 2.1 - Memory Leak in my getCollection function

texts:
So I'm creating a really simple module to read from a custom table. Nothing fancy, table has two rows:

+-----------+--------------+
+ status_id + status_label +
+-----------+--------------+
+ 1         + option 1     +
+-----------+--------------+
+ 2         + option 2     +
+-----------+--------------+

I'm trying to get them into a <select> element so I set up my Block to get the options:

public function getStatusOptions()
{
    return  $this->statusFactory->create()->getCollection();
}

StatusFactory gets auto generated by (I'm in developer mode so is automatic) fine which is good but when I try and use it in my template like this:

<select name="" id="my-select" class="select">
    <?php foreach ($this->getStatusOptions() as $k => $option) : ?>
        <option id="<?php echo $k; ?>">
            <?php var_dump($option); ?>
        </option>
    <?php endforeach; ?>
</select>

but it returns a fatal error of: Allowed memory size of 792723456 bytes exhausted (tried to allocate 400560128 bytes)

but I'm not sure why .. Everywhere online seems to suggest this is the way to do it (and I'm almost 100% on it because Dependacy Injection is the way it seems with M2).

If you need more code let me know, or if you find a duplicate (I couldn't find a solution that worked for me) then please link :)

UPDATE

I know getCollection works, made another function that also uses ->getSize() and it returns the correct ammount of rows, so.. maybe I'm missing something for calling my collection?

Thanks


texts: Code Generator for Services in Magento 2

texts:
Magento 2 recommends us to use Service Contracts and we have to define all getter/setters explicitly in the interface and them provide a base implementation to save fields in the database.

It's a lot of manual work and my question is: is there any code generator available for this task?  Similar as we had for m1?


texts: Magento2 edit shipping address at payment section

texts:
How can i edit shipping address in payment section at checkout page?

I want to update shipping address when user select store pick up shipping address.If anyone idea reply me

I have review this.


texts: How to update checkout/cart/ orders total when promo code is applied dynamically without page reload

texts:
I have changed my checkout/cart/ page promo code to ajax call so that it doesn't get reloaded, while on the success of that ajax call, I have to update the total price summary dynamically without reloading.

How to achieve that.

Need to update this(price summary) as soon as user apply the promo code, I am using ajax instead of reloading the page as it was happening earlier.

I referred some links,

define([
'jquery',
'Magento_Checkout/js/model/cart/totals-processor/default',
'Magento_Checkout/js/model/quote',
'OtherDependencies'
], function ($,totalsProvider, quote){
  'use strict';
  //Your code here
  totalsProvider.estimateTotals(quote.shippingAddress());
});

How this code supposed to work as i dont have any shippingAddress here.

It just promo code and have to update the subtotal and order total with promo amount applied.


texts: SQL Query for gettin all products with custom options

texts:
Need help making a query which returns the sku, name, custom option name and Custom option values for all products with custom options.

Example:

sku | name | Custom option name | Custom option values

1 | Product 1 | Width | M, L

            Height | Red, Blue

2 | Product 2 | Width | M, L

            Height | Red, Yellow


texts:
Magento 2 log has been generating a lot of product doesn't exist entries. I was able to narrow it down to old out of date entries in product_alert_stock referencing products that are no longer on the site.

I'm not entirely familiar with this table, can I simply remove old entries in this table? Are they referenced anywhere else?


texts:
I am trying to create new pages for a custom module I am developing.

the base page for my module is:

www.mywebsite.com/forum

I wanted to add three more pages:

www.mywebsite.com/forum/category
www.mywebsite.com/forum/category/post
www.mywebsite.com/forum/user

I am having a few issues with doing this.

to reach the /forum/category and /forum/user page, It is making me use the url /forum/index/category and forum/index/user. How can i remove the "index" part from the URL?
When I access the page /forum/index/category/post, it is loading up the template .phtml file for /forum/index/category and not the one I have create for Post. The layout .xml file for this page points to the correct template .phtml file. What could be causing this?

Thanks.


texts:
A client has the following condition in which they need to be able to remove tax on specific products.

I've been unable to locate an extension that'll allow to me to set no tax rates on specific products and I'm aware of creating a discount and applying the setting "Apply Discount After Tax", however, that setting is a global configuration which will create a price discrepancy for any other on-going promotions in which sale tax is still applied.

**EDIT: These specific products are part of a promotion in which customers will get free tax and free shipping when using the appropriate promo code.


texts: Removing (tax) lines from checkout review

texts:
At moment my review at the checkout page looks like this:

Subtotal
Delivery Costs
Total without tax
Tax
Total with tax

I would like to hide the lines: Total without tax and Tax. I have tried editing the item.html and tax.php pages but have not been able to hide these lines.

How do I hide these lines? Im using Magento 1.9. Thanks in advance!


texts: Magento 2 - Creating collection triggers print_r or var_dump

texts:
Whenever I call the create() method on my custom collection, the page just displays a print_r (or a var_dump, I don't really know) of the entity that is related to the collection.

Also it looks like the process is exited right after that.


texts: how to add cms static block to newsletter subscriber templates

texts: I would like to know how I can add static block to newsletter subscriber templates


texts: How to validate and Submit Login Form Using Ajax

texts:
i want to create login form using ajax with validation in magento 2.3.5.
so can anyone have idea about it then please share with me.
Thank you in advance.


texts: What is difference between Creating Admin Grid with using Layout and Using Component

texts:
As we are aware that we can create Admin Grid to display list of item from database table with two ways:

1.Using layout

2.Using component

I want to know which one is best and what is difference between both approaches? Please share your thoughts.


texts: Magento 1.9: Password Reset giving Fatal Error

texts:
When customer enter email and press button this error comes

  Fatal error: Class
  'Mage_Adminhtml_Model_System_Config_Source_Customer_Forgotpassword'
  not found in
  /home/public_html/app/code/core/Mage/Customer/Model/Flowpassword.php
  on line 36


texts: How can scroll screen to clicked div in mobile view

texts:
Open link in mobile or in >600px device : http://dev.mpex.com/ee14/team-2018
Click on any team image. after open description cursor goes to top. we need to keep on clicked image. when I click to this image focus needs on this.

if(jQuery(window).width()<=600){
     jQuery(".tc1").on("click",function(){
        jQuery('.main-block-added').hide();
        jQuery(this).find('.main-block-added').toggle();
        jQuery(this).find('.member-name').toggle();
        jQuery(this).find('.member-post').toggle();
    });
}


texts: Magento 2.2 Layered Navigation Category Page issue

texts:
Thank you for taking time to read this:

We have customised our theme to show Category images on Category Pages – and also Category Banners. All this is controlled form the Category Settings from ADMIN backend. Predicament: see attached diagram 1

In order for the Category Images to show need Display setting as: Block

Doing this means the Ajax Layered Navigation Filters don’t work same page is reloaded.

In order for Ajax Layered Navigation Filters to work Display Setting must be : Products Only

Doing this doesn’t show the Category Images and Banners

If we select the Third Option for Display Setting: Static Block and Products  - this solves both things i.e. category images and banners are displayed AND Ajax filters work BUT the filter results are showing on the bottom below the Category Images Content – which is not good or practical as no one will notice them there after applying filters.

Question:

Is it possible to show the filtered results on same page but without the Category Images and Banner? So once the user selects any filter the Category Images and Banners no longer show and only the products show which are relevant to the filter or filters applied in the Ajax Layered Navigation-

A perfect working example from a website can be seen here

https://www.nisbets.co.uk/cleaning-and-hygiene/_/a33-1

Any ideas on how can this be achieved.

We currently have Amasty improved layered Navigation but we have tried others too but issue is stil same

Thank You


texts:
Is it possible to Undo Magento Catalog URL rewrite?
By accident this happened and I was wondering if it´s possible to undo this and then have the old URLs back.


texts:
when I try to access a category page, I get the error ERR_TOO_MANY_REDIRECTS caused by 301 redirects. Also trying by not rewritten url (like "catalog/category/view/id/309"), the result is the same. Instead I have no issue on other routes as product view or checkout/cart.

I have already tried the steps described in this this post.
Can you suggest me how to debug this issue?

Thanks


texts: Magento 2 - checkout_submit_all_after event is not working after checkout completion

texts:
I have need to get Order information in checkout_submit_all_after event observer in Afterpay Payment Method Module. I am trying to add this event in that module.

File Path: app/code/Afterpay/Afterpay/etc/events.xml

<?xml version="1.0"?>
<!--
/**
 * Magento 2 extensions for Afterpay Payment
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_submit_all_after">
        <observer name="afterpay_save_order_after_submit" instance="Afterpay\Afterpay\Observer\SaveOrderAfterSubmitObserver" />
    </event>
</config>

File Path: app/code/Afterpay/Afterpay/Observer/SaveOrderAfterSubmitObserver.php

<?php
/**
 * Magento 2 extensions for Afterpay Payment
 */
namespace Afterpay\Afterpay\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Sales\Model\Order;

class SaveOrderAfterSubmitObserver implements ObserverInterface
{
    /**
     *
     * @var \Magento\Framework\Registry
     */
    protected $coreRegistry;

    /**
     * @param \Magento\Framework\Registry $coreRegistry
     */
    public function __construct(
        \Magento\Framework\Registry $coreRegistry
    ) {
        $this->coreRegistry = $coreRegistry;
    }

    /**
     * Save order into registry to use it in the overloaded controller.
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return $this
     */
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        /* @var $order Order */
        $order = $observer->getEvent()->getData('order');
        $orderId = $order->getId();
        print_r($orderId); die('1');
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/testingObserver.log');

        $logger = new \Zend\Log\Logger();

        $logger->addWriter($writer);

        $logger->info($orderId."OrderId");

    }
}

I only want to use this event. I have checked several other questions where this event is not working but all the answers are asking to use different event. But I don't want to use any other event. Please help me to get work this event in Magento 2.


texts: In Magento backend admin user role accounts taking much time to load

texts:
In Magento backend especially administration user roll accounts taking much time to load(some time getting 504 gateway time out error after clicking on reload button page is loading after some time) and remaining user roll accounts are loading quickly.
Please help me in this issue.
Thanks
Somu N


texts: How to fetch customer detail with soap api in magento 2?

texts: I am trying to fetch customer detail with magento 2 API. but I didn't get solution for that.


texts: Product discount percentage is not showing

texts:
I've added the following code to the checkout page (item.phtml).

$_regularPrice = $_product->getPrice();
$_finalPrice = $_product->getFinalPrice();
if($_finalPrice < $_regularPrice):
    $special_percent = ceil(100 - (( 100/$_regularPrice ) * $_finalPrice )); echo $special_percent.'%'; else: echo '0%';
endif;

This code is showing proper percentage if I add special price to the product. But it is not working if I add Shopping Cart Pricing Rule. The output is always 0% if I add a Shopping Cart Pricing Rule, is there a way to do the same for Shopping Cart Pricing Rule?

Thanks.


texts: What is the difference between `joinField` and `joinTable` in collections?

texts:
In the file app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php, there is a function named joinField and there is another joinTable.

If fields are actually columns in the flat tables, what does it mean to join them? An in what circumstance I should use joinTable instead? Can they both be used interchangeably?


texts: magento 2 rename pub folder to public_html

texts:
I'm using cpanel that cannot change the default document root.
can I just rename the pub folder to public_html like laravel public folder ?

the application already ran with /index.php executed not /pub/index.php this causing many missing image url from migrated data /media not /pub/media.

Thanks


texts: Is there a way to add a wiki in Magento?

texts:
I was wondering if there was already a module or built-in way that I'm missing to add a wiki to a Magento site? I tried looking through modules, the Magento forums/wiki, and didn't find an answer. I was hoping to find something that would quickly be able to add a wiki such as how Magento has it on their own website.

http://www.magentocommerce.com/wiki/

I'd like to be able to have the way a wiki easy links things together but have it use the css/style settings I'm setting in the Magento back-end.

Thanks!


texts: I have a group of customers called "Resellers" I need limit the quantity of products that these customers can buy to 7 units. I need this function and I don't know exactly where I should apply the changes in the code. Please help.


texts: REST API is not updating the product stock quantity in Magento 2.3

texts:
REST API is not updating the product stock quantity.
Request:
https://domain.com/rest/V1/products/1004052/stockItems/361
BODY: {
  "stockItem": {
    "item_id": 361,
    "qty": 500,
    "manage_stock": true
  };
}

Returning:
200 OK
"361"

However, the stock is not being updated. I am not sure why.
I tried a different approach:
http://domain.com/rest/V1/products/1004052
BODY: {
    "product": {
        "sku": 1004052,
        "extension_attributes": {
            "stock_item": {
                "qty": 666 ,
                "is_in_stock": true
            }
        }
    },
    "saveOptions": true
 }

Resonse:
200OK
And the response data shows the updated quantity, however, when I make a GET request on the that product or check in the admin, the stock didn't update.

Any ideas?


texts: Magento 1.9 special price showed after expiration

texts:
I have an issue with the special price. I set expiration date and after expiration, the price showed is the special price.

I tried to reindex price and clean the cache but showed always the special price.

Please help, how can solve it?


texts: Import CSV file Got "General system exception happened" Error

texts:
Steps to reproduce

1.Login to Magento admin panel
2.Select "System" -> "Import"
3.Entity type = "products", Import Behaviour = "Add/Update" - "Stop on error"
4.Allowed errors count = "10", Field Seperator = ",", Multi value seperator ","
5.Select file to import = myfile, Image files directory = "pub/media/import/"
(Remove quotation marks).

Expected result

.CSV should be validated successfully, with 4065 lines (not including headers). Then the products should be imported successfully after clicking "Import"

Actual result

After uploading .CSV, I see a red "General system exception happened"

Please help me to fix this


texts: How to rename Tax option into GST in Magento 1.9 for Australian store

texts:
How  to  convert Tax option of  Magento  store into  GST option in Magento 1.9
1.Setting up tax (GST) in Magento
2.Show Grand Total Excl Tax. I include Incl Tax  in the Store
Invoice show both GST and Tax


texts:
i want to get products ids in Order by using order id,

i tried few methdods for it but none of them seems working

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$orderDatamodel = $objectManager->get('Magento\Sales\Model\Order')->getCollection();
foreach($orderDatamodel as $orderDatamodel1){
print_r($orderDatamodel1->getData());

}

can you tell what i am missing or how to get it


texts:
I tried to put # places of the url, but the url still works and e.stopImmediatePropagation () with js  also didn't help. Is there any way to do this through xml or otherwise?  Thanks

 <item name="buttons" xsi:type="array">
            <item name="alert_text" xsi:type="array">
                <item name="name" xsi:type="string">alert_text</item>
                <item name="label" xsi:type="string" translate="true">Custom Button</item>
                <item name="class" xsi:type="string">primary</item>
                <item name="url" xsi:type="string">*/*/url</item>
            </item>
        </item>


texts: SUPEE-8788 on OSX - illegal byte sequence

texts:
When applying SUPEE-8788 on Magento 1.9.2.4 on OSX I get the following

sed: RE error: illegal byte sequence
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully.

Should I worry about the illegal byte sequence because it states it was applied successfully


texts: Category Missing from Backend and Frontend Menu but in search category showing it's products also showing

texts: Any Help Category Not showing on Backend and Frontend Menu but in search category showing it's products also showing magento 2


texts: Magento 2 disable shipping method based on condition

texts:
By default in my site I have enabled free shipping method if subtotal is greater than 150$. Now I have to disable free shipping method if subtotal after discount is greater than 150$ and enable table rate method.
I have tried just to disable  free shipping anyhow but not working.
<?php
namespace vendor\FreeShippingRule\Plugin;
use Magento\Quote\Api\ShipmentEstimationInterface;

class Shipping
{
    public function beforeAppend($subject, $result)
    {
        if (!$result instanceof \Magento\Quote\Model\Quote\Address\RateResult\Method) {
            return [$result];
        }

        if ($this->isMethodRestricted($result)) {
            $result->setIsDisabled(true);
        }

        return [$result];
    }

    public function isMethodRestricted($shippingModel)
    {
        $code = $shippingModel->getCarrier();
        $restrictedMethod = ['freeshipping'];

        if ($restrictedMethod && in_array($code, $restrictedMethod)) {
            return false;
        }

        return false;
    }
}


texts:
I have in my module's etc/config.xml a block specified as follows:

    <blocks>
        <discoverymiles>
            <class>MyFrontName_MyModule_Block</class>
        </discoverymiles>
    </blocks>
</global>

But when I refresh (admin) page where I am expecting to see the effects of this block (a grid output), I see nothing (the page loads OK but the grid area is blank)
More worryingly, I am not seeing any error output ANYWHERE. Not on the page itself, not in system.log, not exception.log ... nothing.
Expecting to see some kind of 'Block class not found' error (if the class itself is not found which seems to be a logical explanation for it not loading).

Also if I change the  contents to something random 'Blah', still get no error of any kind ...

How to debug this?

any help much appreciated
g


texts: Unable to create shipment programmatically

texts:
I try to create programmatically a shipment of an order with a track code.
This is my current code :

$order = Mage::getModel('sales/order')->loadByIncrementId("100014930");
$shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($order->getItemQtys());

$arrTracking = array(
                'carrier_code' => $order->getShippingCarrier()->getCarrierCode(),
                'title' => $order->getShippingCarrier()->getConfigData('title'),
                'number' => "1234",
            );

$track = Mage::getModel('sales/order_shipment_track')->addData($arrTracking);
$shipment->addTrack($track);

$shipment->register();
$order->save();

With this, I have no error while I execute it.
In the Magento panel, you can't ship the order, but the order stay in pending and the shipment doesn't appear.
Please help

Problem solved with this solution


texts: how can I create two different "about-us " page for two themes and single store view

texts:
I have two themes (desktop and mobile) for a single store view.
I want to create two different "about-us" page for the two themes.

There are also lot of other cms pages which are to be shown in both themes with different styles.

So should I create each cms page two times (one for desktop and other for mobile) ?
 Or
 is there any other methods to show the same cms page in desktop and in mobile with different look ?


texts: I want to know how to change the value of "fotorama _ _ caption _ _ wrap" printed in Magento 2 product details

texts:
Magento 2 outputs the product title by default.

I want to know how to change the title value to a custom attribute (brand) instead of hiding it.

I would also like to know the detailed procedure for changing the template.


texts: Alternative to move a tree type entity instance without calling $entity->move()

texts:
I'm trying to build a tree behaving entity similar to the categories in Magento 2.
Of course I used the Catalog category entity as an example, but this works up to a point.
I'm planning to implement it properly using service contracts.
So in my Move action (similar to this one) my _initEntity method (equivalent to the _initCategory) I don't instantiate the entity model.

I have it something like this (code was changed for explanation purposes so ignore the possible syntax errors. It actually works):

protected method _initEntity()
{
    $entityId = $this->request->getParam('entity_id');
    try {
        return $this->entityRepository->getById($entityId);
    } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
        return false;
    }
}

entityRepository is Api\EntityRepositoryInterface similar to the Cms page repository interface.
This works nicely but my IDE complains that the method move is not available in the interface.
I'm calling $entity->move() similar to this line.

Keep in mind that this works, since the actual implementation of the EntityInterface I'm using is the actual Entity model that contains the move method. So I don't need a way to make it work. I need a way to code it properly.

How should I proceed on this so I would not care about the implementation of the interface?
I could just add the method move in my entity interface but this seams wrong since I should not have this kind of logic in the model itself.
So I don't want to do that.
Any suggestions?


texts: Compile error in theme after updating to 2.1.8

texts:
I have just updated from 2.1.7 to 2.1.8 but when I run:

php bin/magento setup:di:compile

I get an erroe which is:

    [Exception]
  Warning: Declaration of Plazathemes\Override\Controller\Adminhtml\Category\Save::imagePreprocessing($data) should be compatible with Magento\Catalog\Controller\Adminhtml\Category\Save::imagePreprocessing(array $data) in /home/rbadmin/public_html/app/code/Plazathemes/Override/Controller/Adminhtml/Category/Save.php on line 82

The contents of Save.php are below

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Plazathemes\Override\Controller\Adminhtml\Category;

class Save extends \Magento\Catalog\Controller\Adminhtml\Category\Save
{
    private $storeManager;

    /**
     * Filter category data
     *
     * @param array $rawData
     * @return array
     */
    protected function _filterCategoryPostData(array $rawData)
    {
        $data = $rawData;
        // @todo It is a workaround to prevent saving this data in category model and it has to be refactored in future
        if (isset($data['image']) && is_array($data['image'])) {
            if (!empty($data['image']['delete'])) {
                $data['image'] = null;
            } else {
                if (isset($data['image'][0]['name']) && isset($data['image'][0]['tmp_name'])) {
                    $data['image'] = $data['image'][0]['name'];
                } else {
                    unset($data['image']);
                }
            }
        }

        if (isset($data['thumb_nail']) && is_array($data['thumb_nail'])) {
            if (!empty($data['thumb_nail']['delete'])) {
                $data['thumb_nail'] = null;
            } else {
                if (isset($data['thumb_nail'][0]['name']) && isset($data['thumb_nail'][0]['tmp_name'])) {
                    $data['thumb_nail'] = $data['thumb_nail'][0]['name'];
                } else {
                    unset($data['thumb_nail']);
                }
            }
        }

        if (isset($data['thumb_popular']) && is_array($data['thumb_popular'])) {
            if (!empty($data['thumb_popular']['delete'])) {
                $data['thumb_popular'] = null;
            } else {
                if (isset($data['thumb_popular'][0]['name']) && isset($data['thumb_popular'][0]['tmp_name'])) {
                    $data['thumb_popular'] = $data['thumb_popular'][0]['name'];
                } else {
                    unset($data['thumb_popular']);
                }
            }
        }

        return $data;
    }

    /**
     * Image data preprocessing
     *
     * @param array $data
     *
     * @return array
     */
    public function imagePreprocessing($data)
    {
        if (empty($data['image'])) {
            unset($data['image']);
            $data['image']['delete'] = true;
        }

        if (empty($data['thumb_nail'])) {
            unset($data['thumb_nail']);
            $data['thumb_nail']['delete'] = true;
        }

        return $data;
    }
}


texts: I am Facing An Isue While Uding Font Awesome 5 In magento 2 the icon does not come can anybody show me the exact and step by step guide of doing that.


texts: How to show custom product attribute in Items orderd tab Magento 1.9.3

texts:
I have created a custom attribute now i want to show it on in Items Ordered section for every product in sales -> order section.

root\app\design\adminhtml\default\default\template\sales\order\view\items.phtml
i found that above file shows the name Like Product, items Status and all

and the data is i think coming from below code

 <?php $i=0;foreach ($_items as $_item):?>
            <?php if ($_item->getParentItem()) continue; else $i++;?>
            <tbody class="<?php echo $i%2?'even':'odd' ?>">
                <?php echo $this->getItemHtml($_item) ?>
                <?php echo $this->getItemExtraInfoHtml($_item) ?>
            </tbody>
        <?php endforeach; ?>

Now from here i have no idea from where the data is populated in that tabs.

<?php echo "custom_attribute".$_order->getData('custom_attribute'); ?>

even this code shows nothing.

if I print_r($_item); the $_item in

C:\xampp\htdocs\m1\app\design\adminhtml\default\default\template\sales\order\view\items\renderer\default.phtml

i can clearly see the custom_attribute but dont no how to show .

weee_tax_applied_row_amnt] => 0.0000
            [base_weee_tax_applied_row_amount] => 0.0000
            [weee_tax_applied_amount] => 0.0000
            [weee_tax_applied_row_amount] => 0.0000
            [weee_tax_applied] => a:0:{}
            [weee_tax_disposition] => 0.0000
            [weee_tax_row_disposition] => 0.0000
            [base_weee_tax_disposition] => 0.0000
            [base_weee_tax_row_disposition] => 0.0000
            [custom_attribute] => customattr

I found that
echo $this->getColumnHtml($_item, 'name');  this line gave product name and sku
but if i do same with my attribute name as below. nothing is shown.

echo $this->getColumnHtml($_item, 'custom_attribute');


texts: Why magento uses global attribute for configurable product?

texts:
As we all know that Magento requires global scope attribute for creating a configurable product.

But my question is why its needed so?

Why can't we create a configurable product with an attribute with store scope?


texts: I need to move header links in header. For example I need that link "log in" to be first. How I can do this?


texts: How to add a datepicker for a custom field from system configuration

texts:
I follower this tutorial.  You can add easily fields as input text or dropdown, but in my case I want to add the magento datepicker.

I have this function :

public function _prepareToRender()
{
        $this->addColumn('holiday_name', array(
            'label' => Mage::helper('mynamespace_mymodule')->__('Name'),
            'style' => 'width:100px',
            'renderer' => $this->_getRendererDate(),
        ));
}
protected function  _getRendererDate()
{
        if (!$this->_itemRenderer) {
            $this->_itemRenderer = $this->getLayout()->createBlock(
                'mynamespace_mymodule/config_adminhtml_form_field_holidaydate', '',
                array('is_render_to_js_template' => true)
            );
        }
        return $this->_itemRenderer;
}

and this is my block, which extends this class: Mage_Adminhtml_Block_System_Config_Form_Field

protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $date = new Varien_Data_Form_Element_Date;
        $format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);

        $data = array(
            'name'      => $element->getName(),
            'html_id'   => $element->getId(),
            'image'     => $this->getSkinUrl('images/grid-cal.gif'),
        );
        $date->setData($data);
        $date->setValue($element->getValue(), $format);
        $date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
        $date->setForm($element->getForm());

        return $date->getElementHtml();
    }

This is not working, any ideas how can make this work ? thx